in reply to Re^2: Possible to use "split", but save the delimiter?
in thread Possible to use "split", but save the delimiter?
This what you're after?
$s = qq|1-10,20 some.thing [[else]],bla bla bla|;; print "'$_'" for split /([-, .]|\[\[|\]\])/, $s;; '1' '-' '10' ',' '20' ' ' 'some' '.' 'thing' ' ' '' '[[' 'else' ']]' '' ',' 'bla' ' ' 'bla' ' ' 'bla'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Possible to use "split", but save the delimiter?
by ultranerds (Hermit) on Feb 10, 2010 at 17:38 UTC |