They do not only seem pretty much alike. JavaScript uses the same RE as Perl or grep does.
Which lightens the burden of your problem as you now only need a Perl RE parser. :-) Search for that in the search box and you'll get more then a few nodes worth reading :-)
Have a nice day All decision is left to your taste