super-expressive
super-expressive copied to clipboard
Using endOfInput in assertNotAhead
Seems related to #59
It should be possible to use endOfInput
more than once in some contexts.
input
SuperExpressive()
.allowMultipleMatches
.lineByLine
.group
.range("a", "z")
.assertNotAhead.subexpression(
SuperExpressive().endOfInput
).end()
.end()
.endOfInput
.toRegex()
expected
/(?:[a-z](?!$))$/gm
^
actual
/(?:[a-z](?!))$/gm
^
This is missing the $
that tells the match to not match end of the line.
If I do the input without subexpression
,
SuperExpressive()
.allowMultipleMatches
.lineByLine
.group
.range("a", "z")
.assertNotAhead.endOfInput.end()
.end()
.endOfInput
.toRegex()
I get the error "This regex already has a defined end of input"