Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preg_match_all problem

Status
Not open for further replies.

soniclnd

Technical User
Jan 6, 2005
51
US
well... i'm writting a script and i get this error
Code:
Warning: preg_match_all(): Unknown modifier '<' in /home/soniclnd/public_html/newscript.php on line 61
it's complaining about this:
Code:
preg_match_all($regex, $conts, $group, PREG_SET_ORDER);
the regex is
Code:
$regex = "<p class=g><a href=([\D\S]*?)>([\D\S]*?)</a><table cellpadding=0 cellspacing=0 border=0><tr><td class=j><font size=-1>([\D\S]*?)</font><nobr>";
and the subject is a normal HTML page.... any idea what's going on and how i can fix it?
 
Regular expressions need to be delimited with a starting and ending delimiter.
Code:
$regexPattern = "[COLOR=red]/[/color][a-z]+[COLOR=red]/[/color]";
 
and, certain characters need to be escaped with a \, such as the / in your </a> tag. This would need to be <\/a> for instance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top