Regex to find special characters in a String with some exceptions


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.

Best Solution

Try this instead: