preg_replace_callback for Javascript
I had need for something like this recently so I thought I'd share in case someone else needs it....
Tags: beginners, javascript, php, regex