Remove leading whitespaces using variable length lookbehind in RegExp
- by Shizhidi
Hello, I'm wondering if variable length lookbehind assertions are supported in JavaScript's RegExp engine?
For example, I'm trying to match the string "variable length" in the string "[a lot of whitespaces and/or tabs]variable length lookbehind", and I have something like this but it does not go well in various RegExp testers:
^(?<=[ \t]+).+(?= lookbehind)
If it's an illegal pattern, what would be a good workaround to it? Thanks!