Closed Bug 1579867 Opened 1 year ago Closed 1 year ago

SyntaxError: invalid regular expression flag s

Categories

(Core :: JavaScript Engine, defect)

69 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1361856

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.

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.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Resolution: --- → DUPLICATE
Duplicate of bug: 1361856
You need to log in before you can comment on or make changes to this bug.