Why are implementations allowed to extend the regular expressions syntax?

# Benjamin Gruenbaum (9 years ago)

Quoting the specification at www.ecma-international.org/ecma-262/6.0/index.html#sec-literals-regular-expression-literals :

" An implementation may extend the ECMAScript Regular Expression grammar defined in 21.2.1, but it must not extend the RegularExpressionBody and RegularExpressionFlags productions defined below or the productions used by these productions. "

Why are implementations allowed to diverge on regular expressions this way? Has any implementation ever used this ability to extend the grammar?

Does this mean that the source property of a regular expression isn't guaranteed to return a same "length"ed string for every implementation?

Original discussion here: benjamingr/RegExp.escape#27