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 -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -