RegExp free-spacing & comments

Brian Terlson Brian.Terlson at microsoft.com
Fri Nov 6 18:20:38 UTC 2015


RegExp.re or similar seems nice:

```
let re = RegExp.re("x")`
    (\d{3}-)? # area code (optional)
    \d{3}-    # prefix
    \d{4}     # line number
`;
```

But it seems like previous proposals of this want escaping which doesn't seem ideal for this purpose. Do we need both `RegExp.re` and `RegExp.escapedRe`?


More information about the es-discuss mailing list