Sunday, August 26, 2012

jquery – Javascript match

How to get rid of the comma (,) in the output? Is there any better way to search for the url from the string or sentance.



alert(\" http://www.cnn.com df\".match(/https?:\\/\\/([-\\w\\.]+)+(:\\d+)?(\\/([\\w/_\\.]*(\\?\\S+)?)?)?/));


Output from alert is:



http://www.cnn.com,,,,






Rating: 4 out of 5 based on 3 ratings



The post jquery – Javascript match appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/jquery-javascript-match.html

No comments:

Post a Comment