I had just got a similar (but not exact) question answered. I now need help with this question below.
I want to write a regex to match 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 any others should.
I tried writing [\W[^*]] but it doesn't seem it works.
I hope I made it clear. but if not, I apologize. Thanks much for the help.
From stackoverflow
-
Try this instead:
[^\w\*]
-
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 *]
-
[^\w\*]
Simple enough.
0 comments:
Post a Comment