Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Explanation requested regarding negation of characters classes in perlretut

by gjb (Vicar)
on May 29, 2004 at 00:29 UTC ( #357390=note: print w/replies, xml ) Need Help??


in reply to Explanation requested regarding negation of characters classes in perlretut

The point is that \D is the set of all characters that do not belong to \d, so 'a', 'C', '&' all belong to \D. Now similar for \W, the set of all characters not in \w, hence '&', ' ', etc.

So far so good, but [\D\W] is the union of the sets \D and \W, hence it will contain '&' and ' ', but also 'a' and 'C' since the latter are members of \D. That's definitely not equal to the set [^\d\w] that contains none of the characters in \d or \w. The set [^\d\w] definitely doesn't contain 'a' or 'C' that are members of [\D\W].

Hope this helps, -gjb-

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://357390]
help
Chatterbox?
[1nickt]: It's a framework that allows you to specify the Transport agent to whatever you want. You could even write your own.
[1nickt]: Perl300 More doc
[hippo]: In that case, use Net::SMTPS and also encrypt your content before you send it eg. with Crypt::GPG

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-10-17 16:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (234 votes). Check out past polls.

    Notices?