in reply to regex replacement help
One easy way to handle your original problem (without the delim in the output) would be to use
@out = split /~/, $stringNow, since you want the tilde as well, you could simply append ~ to the end of each substring returned by split
@out = map {$_ .= "~"} split /~/, $stringOf course, there would be some edge cases to take care of; I didn't test this all that much. I'm a big fan of regex btw, but TIMTOWTDI
UPDATE: Didn't look closely at solution offered by wind. That's neat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex replacement help
by samarzone (Pilgrim) on Mar 30, 2011 at 07:35 UTC | |
by jaimon (Sexton) on Mar 30, 2011 at 17:06 UTC | |
by samarzone (Pilgrim) on Mar 31, 2011 at 10:36 UTC |