tc39 / proposal-regexp-x-mode

BSD 3-Clause "New" or "Revised" License
24 stars 2 forks source link

Mention XRegExp #4

Open h-h-h-h opened 2 years ago

h-h-h-h commented 2 years ago

Shouldn't XRegExp be mentioned under "Prior Art"?

rbuckton commented 2 years ago

I don't think Prior Art needs to list every existing implementation, but I can look into adding it.

slevithan commented 2 years ago

I'm the creator of XRegExp. No need to add it unless you find it helpful to do so, but for what it's worth, XRegExp is a JavaScript library that converts extended regex syntax into native regexes and has supported the x flag (along with line comments and inline comments, which are also mentioned here) since ~2007.

One thing the XRegExp docs call out that I don't currently see mentioned in this proposal is the two potential meanings of describing whitespace with x as "insignificant":

It might be better to think of whitespace and comments as do-nothing (rather than ignore-me) metacharacters. This distinction is important with something like \12 3, which with the x flag is taken as \12 followed by 3, and not \123. However, quantifiers following whitespace or comments apply to the preceding token, so x + is equivalent to x+.

BTW, I'm excited to see this proposal and hope it progresses.