John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:
But I realized that this is what that "zero width lookbehind assertion" must be for. So, I'm going to review the perlre doc and learn how to use these extensions.
One reason I never bothered with them is that the docs are confusing.
But, to get started, am I correct in thinking that the equivilent would be s/(?<=a)b(?=c)/d/ ? And is that really any clearer?! What does "Works only for fixed-width look-behind" mean? Does that mean I can't have modifiers like + in there? In that case, what's the point, beyond saving a capture number in the cases where it does work?
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex replace in context
by Aristotle (Chancellor) on Dec 11, 2002 at 17:00 UTC | |
by John M. Dlugosz (Monsignor) on Dec 11, 2002 at 21:18 UTC | |
by Aristotle (Chancellor) on Dec 11, 2002 at 21:55 UTC | |
by CountZero (Bishop) on Dec 11, 2002 at 22:52 UTC | |
|
Re: Regex replace in context
by jkahn (Friar) on Dec 11, 2002 at 18:39 UTC | |
by John M. Dlugosz (Monsignor) on Dec 11, 2002 at 21:32 UTC |