unterminated regular expression literal js error
Regular expression literals should be surrounded by the delimiters(/
). There's no terminating delimiter:
/^(https?|ftp):\/\//i
// ^
For example:
>> /^(https?|ftp):\/\//i.test('http://stackoverflow.com/')
true
>> /^(https?|ftp):\/\//i.test('telnet://stackoverflow.com/')
false
You can also get this error if you're simply attempting to concatenate a variable that utilizes a regular expression and forget a quotation mark somewhere.