javascript - Regex only detects the first emoticon? -


here regular expression using detect of emoticons in text:

/[\:][0-9a-za-z'\&\-\.\/()=:;]/.exec(" hi there:d :p") 

but detects first (:d)
problem?
in advance!

i'd suggest use .match() , regex global g flag:

"hi there:d :p".match(/[\:][0-9a-za-z'\&\-\.\/()=:;]/g); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -