Jump to content

"http://.." url recognition


ted_chou12

Recommended Posts

I am no regex expert, and I am sure there's a better way, but I think this isn't a bad regex for URLs:

preg_match("/^(http:\/\/){0,1}[a-z0-9\-]+(\.[a-z0-9\-]+)+[\/]{0,1}$/i", ...);

 

But I may have n00b's mistakes in it! (as far as I have tested it, it's good :))

 

Orio.

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.