[PHP] regex makes my head hurt

2003-03-04 Thread Kris Jones
I've been attempting to figure out regex, and I've realized I need to start over from scratch. And get lots of help! I'm inputting a text file containing html which will contain this: a href=/q?s=IBMd=tIBM/a/font/tdtd nowrap align=center font face=arial size=-12:59pm/font/td td nowrapfont

[PHP] Re: Checking for HTTP:// at the start of a string and more ////

2003-03-01 Thread Kris Jones
Untested: if (preg_match('/^http:\/\/[^\.\s]+\.[^\s]+\/$/i', $string)) // valid string else // invalid string Should match a string beginning with 'http://', followed by one or more characters that are no dots or whitespace, followed by a dot, followed by one or more characters that are