Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //some regular expression
- var exp1 = /a/;
- //some strings
- var str1 = 'somestringwithout';
- var str2 = 'somestringwitha';
- //search for pattern
- str1.match(exp1); // null
- str2.match(exp1); // [ 'a', index: 14, input: 'somestringwitha' ]
- exp1.test(str1); // false
- exp1.test(str2); // true
- exp1.exec(str1); // null
- exp1.exec(str2); // [ 'a', index: 14, input: 'somestringwitha' ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement