Regular expression breaks script execution
I have the following regular expression declaration in my JSX-file:
var regex = /[^/]*(?=\.[^.]+($|\?))/; // Doesn't work while this does: var regex = /[\u0400-\u04FF]+/;
...and it breaks the execution of my script for reasons unknown. What's wrong here? I thought the syntax was / theRegEx /
(commenting away the regex declaration fixes the problem and the script executes normally)
I've tested the regex here:
RegExr: Learn, Build, & Test RegEx
...on this string: "c:/Users/martin.dahlin/Desktop/Test/lolFile.lol"
which gives me "lolFile" without the quotation marks.