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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -