var test = str.match(/test, '/);
As far as I know, quotes have no special meaning within a regular expression and shouldn't need to be in matching pairs. I have also found the same issue with double quotes and parenthesis. Parenthesis have special meaning but even escaped it causes the same problem.
I also discovered a similar issue with the syntax highlighter wanting to see a closing parenthesis inside a regex.
I would say the solution would be to disable checking for closing marks within a /regular expression/.
Now fixed in Git, thanks for reporting.