kalovski

Untitled

Sep 19th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. var input = "your test string",
  2. regex = /B[a-zA-Z\d]+/g,
  3. /*I've added the global modifier 'g' to the regex to get all the matches*/
  4. ary = input.match(regex);
  5. if(ary===null)
  6. alert('No match is found');
  7. else
  8. alert('matches are: ' + ary.toString());
Add Comment
Please, Sign In to add comment