Hi,
did anybody know a good regex tester for javascript (i think there are differents between php regex and javascript? right?)
Thanks in advance!
Peter
Hi,
did anybody know a good regex tester for javascript (i think there are differents between php regex and javascript? right?)
Thanks in advance!
Peter
There are differences, yes. There can even be slight differences in how regex is implemented between browsers (e.g. IE's "JScript" variant vs. Firefox), surprise surprise.
You should find plenty of JS-oriented regex testing tools on the web though. For example, I've used this one in the past, which is written in Javascript:
It's actually for Ruby but it's pretty good for testing most standard regex. It allows lookbehind though which Javascript does not implement.
A very good (though not free) regex tester, debugger and converter is RegexBuddy. It's especially handy if you need to convert regular expressions from one flavor to another, and there is a grep tool built in.
For a tester, try RegexPal. About differences, there are quite a few. The most importantant ones are:
PHP's preg_*
regexes support lookbehind assertions and conditionals, while Javascript regex doesn't. For a more detailed list, visit: