Asterisk in eregi
- by Mihai
//URL START
$urlregex = "^(https?|ftp)\:\/\/";
// USER AND PASS
$urlregex .= "([a-z0-9+!*(),;?&=\$_.-]+(\:[a-z0-9+!*(),;?&=\$.-]+)?@)?";
// HOSTNAME OR IP
$urlregex .= "[a-z0-9+\$-]+(.[a-z0-9+\$_-]+)*";
// PORT
$urlregex .= "(\:[0-9]{2,5})?";
// PATH
$urlregex .= "(\/([a-z0-9+\$_-].?)+)*\/?";
// GET Query
$urlregex .= "(\?[a-z+&\$.-][a-z0-9;:@/&%=+\$.-]*)?";
// ANCHOR
$urlregex .= "(#[a-z_.-][a-z0-9+\$_.-]*)?\$";
// check
if (eregi($urlregex, $url)) {echo "good";} else {echo "bad";}
but what if I have http://www.example.com/about-me/my-4*-hotel/
That eregi check isn't valid because of the asterisk. What should I do?