Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var input = "your test string",
- regex = /B[a-zA-Z\d]+/g,
- /*I've added the global modifier 'g' to the regex to get all the matches*/
- ary = input.match(regex);
- if(ary===null)
- alert('No match is found');
- else
- alert('matches are: ' + ary.toString());
Add Comment
Please, Sign In to add comment