Druide Posted April 5, 2010 Share Posted April 5, 2010 I've a question about how use the regular expression to find a tag. For sample. I've a code: <div class=Section1> <p class=Title><o:p> </o:p></p> <p class=Title align=center style='text-align:center'>title title title title </p> <p class=Title><o:p> </o:p></p> <p class=Author><st1:PersonName ProductID="" w:st="on">Name</st1:PersonName></p> <p class=Author>Some <st1:PersonName ProductID="" w:st="on">thing</st1:PersonName> about the author</p> <p class=Author>More about the author</p> <p class=Author><o:p> </o:p></p> <p class=chapter>1. chapter 1</p> <p class=Text>text...</p> <p class=Text>text...</p> Yes, it's with garbage from msword. I need take in this code the follow: Name Some thing about the author More about the author I tried but I can't get the point. If I use like this: preg_match_all('#<p class=Author>([^<]*)</p>#s',$text,$val); Don't work, 'cause there are more </p> in the text. How I do for it stop in the first </p>? Thanks 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.