/ Published in: ActionScript 3
Founds this via http://www.flashcomguru.com/index.cfm/2009/2/17/regexp-validate-url
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var url:String = "http://www.google.com"; var regex:RegExp = /^http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?$/i; trace(regex.test(url)); // returns true if valid url is found
URL: http://www.flashcomguru.com/index.cfm/2009/2/17/regexp-validate-url