in reply to Re: Splitting string using two overlapping patterns
in thread Splitting string using two overlapping patterns
print "$1\n" while $line=~s/(\w+\s+\w+|\w+)[}|\s+|\s+{]//;
Metacharacters like | are not meta-special in a character class, so [}|\s+|\s+{] from the quoted regex is equivalent, with the pipe metacharacter explicitly escaped (for clarity), to [\s{}\|] or, less verbosely, to the [\s{}|] class. (In other words, there's no alternation in a character class.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Splitting string using two overlapping patterns
by Lennotoecom (Pilgrim) on Oct 24, 2013 at 21:32 UTC |