Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check if string contains url

var reg = new RegExp('([a-zA-Zd]+://)?((w+:w+@)?([a-zA-Zd.-]+.[A-Za-z]{2,4})(:d+)?(/.*)?)', 'i')
if (reg.test(status_text)) {
    alert(reg.exec(status_text)[2]);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #string #url
ADD COMMENT
Topic
Name
4+1 =