|
|
| "be consistent" | |
| PerlMonks |
Re^4: RegEx related line splitby remiah (Friar) |
| on Nov 14, 2011 at 12:40 UTC ( #937937=note: print w/ replies, xml ) | Need Help?? |
|
Try to explain myself. foo|bar is foo or bar. if it is grouped by (foo|bar), the matched $1 will be set to "foo" or "bar". In this case ... it is not "non capturing grouping" (?foo|bar), because it is zero width look ahead assertion '(?='. Zero width look ahead assertion works like place holder and it does not eat up pos($expr) in matching. $ is the end of line... as far as I know. Well, it says look ahead for "end of line" or MARK and match against them as 'place holder'. I think I understand this!
Thank you very much JavaFan.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||