I have a form generator that uses (perl compatible) regexes for ther backend validation. Since the whole form is being dynamically generated it was fairly trivial to add a
PHP preg_* functions and JavaScript both use Perl-compatible regular expressions. In principle, they should support the same set of regular expressions.
You really should give some examples of what is not working, because it is very likely that your problem is due to escaping/string handling.