You need to sign in to do that
Don't have an account?
URL format validation
Hello,
Can anyone please help me in validating URL format ?
I used the following Regular expression but it is working good, its showing even valid URL's as Invalid
^((http|https)://)??(www[.])??([a-zA-Z0-9]|-)+?([.][a-zA-Z0-9(-|/|=|?)??]+?)+?$
Use the following regular expression to validate URL format: -
/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i
And don't forget to mark this answer as best, if answer this helps you :-)
--
Regards,
Grazitti Team
Web: http://www.grazitti.com
I am getting Syntax error when i used your regular expression :(
Can you please try the "jquery validate" to valiadte the Url format?
Please see the below link and code for refrence:
http://jqueryvalidation.org/url-method
VisualForce Page:
Please mark as best answer if it solves your problem.
Regards,
Grazitti Team,
www.grazitti.com
Hey hi,
I need to write for some field in an Sobject ,
I tried in NOT(REGEX(url,^((http|https)://)??(www[.])??([a-zA-Z0-9]|-)+?([.][a-zA-Z0-9(-|/|=|?)??]+?)+?$)) but no use...
Now I used IF() it is working now
thnks for reply