regexp-make-js
regexp-make-js copied to clipboard
ES6 string template tag for creating dynamic regular expressions
There's zero reason in 2015 to use a loop, or "var" - this cleans some of them up. There's still a bunch left, but I figured I'd tackle just a...
`RegExp.make`${ /(foo)/ }(bar)`` has 1 group in the template, (bar). In the matched output, this group will be at an index 1 + numberOfGroupsIn(/(foo)/), in this case 2. Figure out...
I don't see spec text yet, so it may not be a problem yet - but let's make sure that ```js class Foo extends RegExp {} ; Foo.make`${foo}` ``` returns...
https://rawgit.com/mikesamuel/regexp-make-js/master/test/index.html now works in Chrome Canary 50 as well, so the failure text should mention this in addition to modern Firefoxen.
When regex instances are interpolated in blocks, the comment mentions "_With back-references adjusted_". What does that mean? The tests don't really help me to understand this: ``` js RegExp.make `^(#+)([^#\r\n]*)${...
Status
Hey, where does this repo stand? How can we help progress this in the spec?
The [Expressions table](https://github.com/mikesamuel/regexp-make-js#expressions) does allow arbitrary values to be inlined "without inlining" in some contexts. I think that's a bad idea. This wording seems to suggest that the following things...
The current regex grammar is quite [liberal](http://www.ecma-international.org/ecma-262/6.0/#sec-regular-expressions-patterns) about `SyntaxCharacter`s that appear in places where they are not allowed. For example, `/a{/` is just taken literally. This complicates parsing, and deciding...
The problem of current conception in flags. Because of them, `RegExp.make` should return a function. What about simple solution: ``` js RegExp.make`${source}` RegExp.make('igm')`${source}` // -> RegExp.make`/${source}/` RegExp.make`/${source}/igm` ``` ? Like...
If we can do `myMake = RegExp.make("")("g")("i")("")…` anyway, let it be useful at least :-) I wonder what TC39 will say to this pattern, though. There are no curried functions...