SyntaxError: invalid regular expression flag s
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: t20, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
Wrote a JavaScript program including a regular expression /.../sg .
Actual results:
Firefox did not execute my program. Console shows "SyntaxError: invalid regular expression flag s". Seen in 68.0.2 and 69.0 .
Expected results:
Program should have run without error. Note: Firefox documents "s" flag: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp and I need it so ".*" will match newlines.
Reporter | ||
Comment 1•5 years ago
|
||
Workaround is to use [^\x05]* instead of .* (\x05 is my favorite unused control character for internal uses). However, bug should be fixed anyway, since some may not know this workaround and because the s flag is documented.
Updated•5 years ago
|
Description
•