To find a match with a regular expression, use match
on strings (returns an array of matches):
js
var s = "abc";
s.match(/c/); => ["c"]
or test
on RegExp (returns true or false):
js
/c/.test(s); => true
8 October 2014
To find a match with a regular expression, use match
on strings (returns an array of matches):
var s = "abc";
s.match(/c/); => ["c"]
or test
on RegExp (returns true or false):
/c/.test(s); => true