Hi ineya,
I considered using php's dom extension (http://tr2.php.net/manual
Main Topics
Browse All TopicsHello,
My html code is:
<templateblock name="A">
<templateblock name="B">
</templateblock>
</templateblock>
My Pattern:
/<templateblock name=\".*?\">([\w\W]*)<\/t
This pattern does not work because it gets from the beginning of template block A through en of template block B.
My first question is:
How can i retrieve whole content of templateblock A?
My second question is:
How can i retrieve only the content of first level template blocks, just ignore the blocks in blocks?
Note: template block name attribute values may change.
This question is in progress.
Our experts are working on an answer right now.
Sign up for immediate access to the solution once it becomes available.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi ineya,
I considered using php's dom extension (http://tr2.php.net/manual
I tested your pattern in expresso (http://ultrapico.com/Expr
<templateblock name="B"></templateblock>
first questions: This seems like whole content of templateblock 'A'. What is the problem you see with this?
second question: I doubt you can write single regexp to do this.
I would go for DOM parser.
Business Accounts
Answer for Membership
by: ineyaPosted on 2008-05-17 at 02:25:43ID: 21588534
Do you have to use patterns? Can't you use XML parser?