I have this in my JavaScript,
alert(words.match(\b.(\w*)\b));
, where words
is a string previously defined. But, the regex (\b.(\w*)\b
) is producing a console error Uncaught SyntaxError: Unexpected token ILLEGAL
. I think it's the backslashes, but no matter what I do, I still get the problem. I have thoroughly researched this problem on Stackoverflow and Google, but none of the results either works or meets my situation.
Here is the regex I am using: http://regexr.com?36u4v. Any held would be greatly appreciated.