Re: regexp help
Fabrizio Lippolis <[email protected]> Fri, 12 Jan 2007 15:35:43 +0100
| Newsgroups | gmane.comp.jakarta.regexp.user |
|---|---|
| Message-ID | <[email protected]> |
Arnaud Bourree ha scritto: > Hi, > > My 1st response should be why not used XSLT instead of Regex The reason is that in the beginning I have to treat the XML as pure text just as I receive it without modification. Using XSLT to me requires performing a parsing which generates a DOM tree where lose original formatting (there could be spaces between tags which are important to me). > But if you percist on Regex: > (?:<inner_tag>([^<]+)</inner_tag>\s*)+ > > Could help you. Thank you for your help, maybe I failed to explain the problem the right way but this expression returns all the <inner_tag>s in a single group. What I need is to get in one group is a single <inner_tag>text</inner_tag> where the number of <inner_tag> is unknown before. So I need as many groups as the number of <inner_tag>s. Fabrizio