diotalevi has asked for the wisdom of the Perl Monks concerning the following question:

I recall discussion of a feature in the regexp engine supporting set operations on character classes. I would like to use the character class [[:punct:]] minus [,"\s]. Isn't there a syntax to support that directly? I can't recall it and can't find documentation to support it. Whatever happened to that?

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re: Character class set operations? (^..^)
by tye (Sage) on Oct 23, 2007 at 03:32 UTC
    [^[:^punct:],"\s]

    Update: [:punct:] doesn't include any whitespace characters (in my testing) so your request to exclude \s and my \s are likely superfluous, FYI.

    - tye        

Re: Character class set operations?
by ysth (Canon) on Oct 23, 2007 at 04:18 UTC
    and the documentation is in perlre just after the list of character class names:
    You can negate the [::] character classes by prefixing the class name with a ’^’. This is a Perl extension.