Level 4
Jun 26, 2019
3
Level 3
Regex to test if text contains a URL
Hey,
I have a text field that I'm trying to validate where users should not be able to paste in URL's. I kinda had the regex rule working for this, but it was failing when someone added any words that included com - like company for example.
Is anyone able to help me out here? :-)
Level 88
This is pretty hard to get 100% right, but you should be able to find some almost perfect regexes here: https://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string
1 like
Please or to participate in this conversation.