in reply to Re: ^\s not equal \S?
in thread ^\s not equal \S?
Well, I finally did it. I ++'d an anonymous post. Good answer. I was going to say something like:
[^\s\w] means neither spaces nor words, or, everything but spaces and words, where
[\S\W] means non-spaces AND non-words, and since a space is a non-word, the meaning is similar to "non-spaces and spaces".
However, ^\s and \S should be the same, so...
would do the same thing as...$phrase =~ s/[^\s*\w*]//g;
$phrase =~ s/[\S]|[\W]|[^*]//g;
Update: No, it wouldn't. :: smacks self in head ::
In Section
Seekers of Perl Wisdom