View Single Post
Old 12-21-2009, 02:08 PM   #1 (permalink)
benton
The Contributor
 
Join Date: Apr 2008
Posts: 78
Thanks: 0
benton is on a distinguished road
Default Why does this preg_match fail?

Can someone plase explain why this statement fails?
PHP Code:
preg_match('/<h1>(*)<\/h1>/i'$line$matches); 
The failure results in the warning
Quote:
Warning: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 5
If I enter this line instead (just to test the code), it works.
PHP Code:
preg_match('/<b class="main">(.*)<\/b>/i'$line$matches); 
benton is offline  
Reply With Quote