in reply to Explanation requested regarding negation of characters classes in perlretut
The "Think DeMorgan . . ." statement says it. A []-defined character class is structured like logical "or", so a character matching [\D\W] is either in \W or in \D (That's actually a degenerate example since \w contains \d). So [^\d\w] is logically "not (d or w)". DeMorgan distributes "not" over "or" as "(not d) and (not w)", while [\D\W] translates as "(not d) or (not w)".
After Compline,
Zaxo
|
|---|