I'm using Node.js for a project, and I'm finding Javascript's regex syntax very limiting. Specifically the lack of lookbehind is killing me. I'm trying to use regex to parse strings into sentences, but I want to check for common abbreviations such as Mr. and Mrs. so that I don't break the sentences up. Is their a Node.js library that adds regex features, and if not what would a good course of action be?
It's the difficulty with javascript regexes,
A way to avoid your specific problem:
/((?:Mrs?\.)|[^\.]+)+/ # match all that is not a dot or Mr. or Mrs.
For more tricks, you can take a look at this site: http://blog.stevenlevithan.com/archives/javascript-regex-lookbehind
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With