Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

speedydan's avatar

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? :-)

0 likes
3 replies

Please or to participate in this conversation.