-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Original report by boolbag NA (Bitbucket: boolbag, GitHub: boolbag).
Hi again Matthew,
This is the third in a series of posts to present a case for three features. In this post, I'll focus on (*SKIP)
. This is probably the lowest priority one as I use it the least, but when I do use it, it is just wonderful.
The (*SKIP)(*FAIL)
syntax shows its worth when you want to match something except in certain contexts. Instead of trying to avoid the "bad context", you deliberately match it, add (*SKIP)(*FAIL)
, then an OR |
, then match what you actually want.
Some time ago I showed how this works on here.
I realize that Perl and PCRE have other control verbs such as (*PRUNE)
, but I am yet to see a convincing use case for those, whereas (*SKIP)(*FAIL)
can be used quite often. So it seems to me that it would be quite alright to implement (*SKIP)
without bothering about the others.
Thanks in advance for considering it.