Jump to content

url regex


phorcon3

Recommended Posts

i need the regex to validate urls, such as

 

1) www.google.com

2) http://www.google.com

3) https://www.gogle.com

4) htt|ps://www.google.com/index.php?q=blah & www.google.com/index.php?q=blah

5) as well as .../index.php?q=blah&q2=blah2&q3=blah3...

6) http://google.com

 

/(https?:\/\/)?(\w{0,3})?(\w)*?/

 

would that work?

Link to comment
https://forums.phpfreaks.com/topic/177716-url-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.