For the benefit of others who may be using Java, .NET, XML schema, or JGSoft/RegexBuddy, there is actually a character subtraction mechanism for those flavors: stackoverflow.com/questions/3201689/… ; e.g. [a-z-[aeiou]] in .NET matches a lowercase consonant.
– polygenelubricants
1 Answers
60
votes
Use a negated class including \W or \S.
/[^\W_]/ # anything that's not a non-word character and not _
/[^\S\t]/ # anything that's not a non-space character and not \t
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
[a-z-[aeiou]]
in .NET matches a lowercase consonant. – polygenelubricants