[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

How to find only parent tags

Asked by blacklord in Regular Expressions

Tags: PHP, Regular Expressions

Hello,

My html code is:

<templateblock name="A">
    <templateblock name="B">
    </templateblock>
</templateblock>

My Pattern:
/<templateblock name=\".*?\">([\w\W]*)<\/templateblock>/U";

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.
 
Related Solutions
Keywords: How to find only parent tags
Title
1 Javascript Menu
 
Loading Advertisement...
 
[+][-]05/17/08 02:25 AM, ID: 21588534Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/17/08 02:46 AM, ID: 21588568Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/17/08 05:04 AM, ID: 21588872Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/23/08 06:05 AM, ID: 21631696Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628