Thanks, Jim! That's exactly what I needed. J. Jim Lucas wrote:
> not sure why you have such a complex reg there, but will this work for you. > > preg_replace("/(http:\/\/)?([^\/ ]*)(.*);/", "http://\\2\\3", $str); > > \\1 = http:// ; if there > \\2 = domain > \\3 = request_uri > > Jim Lucas > ----- Original Message ----- > From: "J. Younker" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, June 05, 2002 8:22 AM > Subject: [PHP] Regular Expressions Help > > > Hi, > > I'm trying to use eregi_replace to check a user-submitted URL, but I > > keep getting the following error message: > > Warning: Invalid range end in /var/www/html/_db_db/db_input.php > > This what I'm using: > > $pattern = "(http://)?([^[:space:]]+)([[:alnum:]\.-_?/&=])"; > > $replace = "http://\\2\\3"; > > $URL = eregi_replace($pattern, $replace, $URL); > > I've stared at this expression for too long and can't figure out what's > > wrong. > > Thanks, > > J. Younker > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php