

Ask HN: Better Regex Support for JavaScript? - paulbaumgart

My understanding is that regex in JavaScript is fairly crippled. http://www.regular-expressions.info/javascript.html lists a number of missing features. The most salient of these seem to be:<p><pre><code>  # Lookbehind is not supported at all. Lookahead is fully supported.
  # No atomic grouping or possessive quantifiers 
</code></pre>
One way to fix this would be to write a regex engine in JS. Does anyone know of any such projects? Alternatively, does anyone know of any other ways of supporting fully-featured regex in JS?<p>(Making a request out to a web service written in a language with better regex support is the default option, but I'm hoping to find something with less external dependencies.)<p>Thanks!
======
skennedy
Someone who offers three solutions to mimic lookbehind's in Javascript:

[http://blog.stevenlevithan.com/archives/mimic-lookbehind-
jav...](http://blog.stevenlevithan.com/archives/mimic-lookbehind-
javascript/comment-page-1)

Also, there seems to also be a lot of support for leveraging PHP's regex
functionality on the server-side to accomplish this.

