I have a regular expression here, and I want it to return only users, comments, and posts. However, even though I have \s, whitespace, in my negative character set, it still is extracting a match from it. Why is this?
I have a regular expression here , and I want it to return only
Share
It seems did not match any space character, but just a position, since * will match a string with length 0.
Try
([^\s().,]+)