consider the following code:
perl -wne 'chomp;print if m/[^(?:test)]/'
I was surprised to see that grouping inside a character class works, How does this differ from (?!pattern)
?
/[^(?:test)]/
is not grouping within the char class. All the char listed in the [ ] after ^ will be treated literally and this will match any string that contains char other than (
?
:
t
e
s
t
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With