So I want to match the case where I have 2 times mysubtag within a mytag. So:
...<mytag>.....<mysubtag>...</mysubtag>..<mysubtag>...</mysubtag>....</mytag>...
where ... are random symbols including newlines.
I don't want to match 2 mytags with each 1 subtag
...<mytag>.....<mysubtag>...</mysubtag>....</mytag>...<mytag>.....<mysubtag>...</mysubtag>....</mytag>...
Is there a trick to it?
i do the matching in eclipse and what I got so far is:
<mytag[\s\S]*?<mysubtag[\s\S]*?</mysubtag>[\s\S]*?<mysubtag[\s\S]*?</mysubtag>[\s\S]*?</mytag>
but this matches the second example
EDIT So bottom line: don't use regexp for these tasks I started a new thread there Xpath find files for windows? xml parser to find files in windows