Open Y-- opened 3 years ago
Thanks for raising this. The problem is that the library currently doesn't support start or end of string assertions within alternations.
see the spec test here: https://github.com/ColinEberhardt/assemblyscript-regex/blob/main/assembly/__spec_tests__/generated.spec.ts#L2205
The current implementation assumes that these occur at the start or end of the regex string: https://github.com/ColinEberhardt/assemblyscript-regex/blob/main/assembly/regexp.ts#L126-L132
Happy to give it a shot, if you have any hint where to start looking it would probably save me a lot of time :-)
That would be great! The assertion logic is applied in this function: https://github.com/ColinEberhardt/assemblyscript-regex/blob/main/assembly/regexp.ts#L153-L222
As an aside, it would probably be useful for this library to throw an error if you use a regex that has features that are not supported yet.
Awesome, thanks a lot for this feedbacks! I'll try to give it a shot ASAP, not sure exactly when though (hopefully in the next few months). And definitely +1 to throwing if not supported :-)
Hello!
Here is the test to reproduce the issue:
While in Javascript:
Or on one line:
Happy to give it a shot, if you have any hint where to start looking it would probably save me a lot of time :-)
Thanks!