Skip to content

Pattern: clarification on whether leading and trailing delimiters are allowed or required #1478

Closed
@spacether

Description

@spacether

So the definition of pattern is:

6.3.3. pattern

The value of this keyword MUST be a string. This string SHOULD be a valid regular expression, according to the ECMA-262 regular expression dialect.
A string instance is considered valid if the regular expression matches the instance successfully. Recall: regular expressions are not implicitly anchored.

Does that include the regex literal delimiter / which means that pattern values must look like /pattern/flags (ECMA-262 15.10 or 7.85) or does it just include the pattern (ECMA-262 15.10.1)?
The spec is unclear because it does not link to a specific section of ECMA-262
Can this be clarified? What is allowed? What is required?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions