Hi,

Given a RegExp object `rx` and a string `f` that contains legal RegExp flag 
characters, should ideally the following expressions

```js
RegExp(rx, f)
eval("/" + rx.source + "/" + f)
```

always return a functional regexp?

Practical example: `rx = /\-/`, and `f === "u"` (recall that `\-` is invalid in 
u-regexps but valid in non-u-regexps).

One may wish that `RegExp(/\-/, "u")` and `eval("/" + /\-/.source + "/u")` be 
both equivalent to `/-/u`.

Context: That question came up while I was thinking about a possible precise 
specification for `RegExp.prototype.source`.

—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to