Reputation: 1180
What's the best way match all punctuation characters in the class [[:punct:]]
except @
and #
?
Upvotes: 2
Views: 570
Reputation: 532
[[:punct:]]
is equivalent to [!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]
See: http://www.regular-expressions.info/posixbrackets.html
You can simply extract the symbols you don't want:
[!"$%&'()*+,-./:;<=>?[\]^_`{|}~]
Upvotes: 1