in reply to Perl regex in real life
Anyway, there are lots of the "more advanced" features (the ones you named, look-ahead and look-behind assertions, non-backtracking groups...) that I use now and then in regex that ease my work. I just don't think of them as being special, so I don't remember the applications.
In "Mastering Regular Expressions" there's a nice example: A regex for detection accidentally duplicated words words in text. For that you need backreferences (something like m/\b(\w+)\s+\1\b/)
There are other features that are more unique to perl, like the "keep assertion" \K (new in perl-5.10, see perlre for details). That's very useful when you want to delete everything after a regex match: s/$regex\K.*//s
|
|---|