frizi Posted March 12, 2010 Share Posted March 12, 2010 Hi It would be great if you could help me with my problem. I would like to use a regex expression (or a php script) that would select one complex tag. The complexity at this is that the tag could contain the same tag inside (at menu content for example - ul li ul). Therefor I need a special code that would search so many closing tags as many opening tags for matching the following first UL: <ul> <li> first </li> <li> <ul> <li> second </li> <li> <ul> third </ul> </li> </ul> </li> <li> <ul> <li> fourth </li> </ul> </li> <li> end of selection </li> </ul> <ul> this should be not selected </ul> I need to search so many opening tags as closing tags from the first tag (ul) until next different tag. It was told me that I should use Dom document. This is not possible because I'm working with transitional style html style and I need just the first level (main) tags. Thank you in forward. Quote Link to comment Share on other sites More sharing options...
salathe Posted March 12, 2010 Share Posted March 12, 2010 You should be using the DOM. If you're having trouble doing that, please ask questions. Any regex solution will be far more complicated and difficult to maintain and understand in the future (or even, now). 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.