in reply to Re: expanding the functionality of split
in thread expanding the functionality of split
This will actually fail because it will split on ':' before '::' and thus return unwanted null fields. You need to do /::|:|\s+/. See below....
$string = "a:b::c d"; @fields = split(/:|::|\s+/, $string); print "Got '$_'\n" for @fields; __DATA__ Got 'a' Got 'b' Got '' Got 'c' Got 'd'
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: expanding the functionality of split
by runrig (Abbot) on Dec 10, 2002 at 00:20 UTC | |
by tigervamp (Friar) on Dec 10, 2002 at 00:51 UTC | |
by tachyon (Chancellor) on Dec 10, 2002 at 01:33 UTC | |
by Abigail-II (Bishop) on Dec 10, 2002 at 17:03 UTC | |
by tachyon (Chancellor) on Dec 10, 2002 at 20:24 UTC |