If you are trying to do regular expressions you should look up how they're accomplished in Javascript.
http://www.w3schools.com/jsref/jsref_obj_regexp.asp
It should be noted that regular expression support in Javascript varies quite a bit depending on what version of the ECMAScript the javascript interpreter is based on.
Here is a handy javascript regex tester that works in the browser, bearing in mind that browsers usually support the most common (ie: the least) regex capabilities:
http://www.regular-expressions.info/javascriptexample.html
↧