Any good regex rules for validation?
Currently, i am searching regex rules for validate url. And i am struggled how to build this from scratch. Is anyone have a good resources on this topic?
Just find out this site, when you type the regex rule, it will explain it instantly. It's really cool.
Validating URLs is tough for the same reasons that validation on emails is tough. You can't verify the url or email is correct or live, only that it fits a format with regex.
It looks like Diego's regex here is the best option for correctness. https://mathiasbynens.be/demo/url-regex
Another great site for testing regex is http://rubular.com
Thank Chris, you save me ton of time :) I own you a starbuck!
Diego's regex look prefect for me, and i just realize the jquery validation plugins "formvalidation.io" also using this rule for validate url
Below is the ruby version i use
Thanks to both for the information. I've been looking for some regex tips on validating URLs and some better email validation techniques. :)