Reputation: 235
I just had a similar (but not exact) question answered. Now I need help with the question mentioned below.
I want to write a regex which matches a character if its a non word, non digit and non star (*) character. So, the characters [0-9][a-z][A-Z] *
should not match and the others should.
I tried writing [\W[^*]]
but it doesn't seem to work.
Upvotes: 8
Views: 63972
Reputation: 7033
The simplest regular expression that matches a single character, that is not one of those you described, independent of any particular regular-expression extensions, would be:
[^0-9a-zA-Z *]
Upvotes: 7