cmic has asked for the wisdom of the Perl Monks concerning the following question:
# # Negative lookbehind , huh ?? # while (<DATA>) { if (/(?<!TAGS)(.*?)(?=TAG2)/xgi ) { print "Negative lookbehind: "; print $1, "\n"; } } # __DATA__ TAG1 text one TAG2 TAG1 text two TAG2 TAG1 text three TAG2 TAGS text four TAG2 TAG1 text five TAGT TAG1 text six TAG2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: lookbehind regexp
by tybalt89 (Monsignor) on Jun 10, 2019 at 14:50 UTC | |
|
Re: lookbehind regexp
by hippo (Archbishop) on Jun 10, 2019 at 14:55 UTC | |
|
Re: lookbehind regexp
by Athanasius (Archbishop) on Jun 10, 2019 at 15:01 UTC | |
by Anonymous Monk on Jun 11, 2019 at 13:41 UTC |