in reply to reg-exp problem
In a regex, [] surround a "character class", meaning that it matches any of the characters inside the square brackets.
Since split divides a string based on its delimiter regex, in this case, your input string is being split on any of the { } , * characters.
$ $ perl -e'print "$_\n" foreach split /[,{}*]/,"this{is*a}test,of"' this is a test of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reg-exp problem
by perlplayer (Sexton) on Sep 09, 2008 at 11:42 UTC |