ColinEberhardt / assemblyscript-regex

A regex engine for AssemblyScript
MIT License
86 stars 12 forks source link

Add backspace [\b] character class #14

Closed MaxGraey closed 3 years ago

ColinEberhardt commented 3 years ago

Thanks @MaxGraey - although I don't think this implementation is correct. The regex \b matches a word boundary, whereas [\b] matches a backspace.

MaxGraey commented 3 years ago

I know so I tied cover only [\b] case (backspace). I think in this case it is no different from \t, \n ant others. Should I do some extra checks for matching \b?

ColinEberhardt commented 3 years ago

I think in this case it is no different from \t, \n ant others

No, I'm afraid not.

https://www.typescriptlang.org/play?#code/PTAEFsEMBcGMAtSVAI0rA1gZwA7oKYCwAULAPYB2W0oATvgOb4AeAjKALygX4DuoAJUYBRZjgAUAIgBmZMgG0AOopQBdNLUkBKEuSpkANvgB0Bsg3H0mbYy3ywpssio3atAbhIkQEGAiSgvGS0ACaoZACuFCGQtACeupTUdIwsAEyc3HyCImJSMMoo2on6RqbmlqnMabbM9lKwMKCNcPBu7kA