ionik Posted April 6, 2008 Share Posted April 6, 2008 The problem im having is that the regex works but when i use it here it doesnt work correctly even though what im parsing is contained if(!eregi('^\<\!---GROUP DEFINITION---\[([a-zA-z]+)\]---END DEFINITION---\>$', $this->file_contents)) { } Parsing Fetching This --- >> <!---GROUP DEFINITION---[group]---END DEFINITION---> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{WEBSITE_NAME}</title> Why isnt this work? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted April 7, 2008 Share Posted April 7, 2008 well you aren't parsing the beginning so you don't need the ^ or the end so you don't need the $. try something like (this is a guess): <?php if(!$eregi('/<!---GROUP DEFINITION---\[([a-zA-Z]+)\]---END DEFINITION--->/', $this->file_contents)) { } ?> http://devolio.com/blog/archives/30-Regular-Expressions-in-PHP.html this is a good website to learn Regex with PHP Just tested and it does work. Just a FYI you should click the Solved Topic button if you topic gets solved. I saw that you put solved in a post an another thread but you didn't click the button. Quote Link to comment Share on other sites More sharing options...
ionik Posted April 7, 2008 Author Share Posted April 7, 2008 hey thanks for the response i got it workin just flipped the statement around dont know what would cause that though Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.