regex pattern question
Hi,
I'm trying to get my feet wet wtih java and regular expressions, done a lof of it in perl, but need some help with java.
I have an xml file (also working through the sax tutorial, but this question is related to regex)that has multiple elements, each element has a title tag:
<element lev1>10<title>element title</title>
<element lev2>20<title>another element title</title>
</element lev2>
</element lev1>
If I have the following pattern:
Pattern Title = Pattern.compile("(?i)<title>([^<]*)</title>");
that picks up the titles, but I can't distinguish which title belongs to which element. Basically what I want to have is:
Pattern coreTitle = Pattern.compile("(?i)<element lev1>(**any thing that isn't an </title> tag**)</title>");
looked through the tutorials, will keep looking, I'm sure it's in there somewhere, but if someone could point me in the right direction, that would be great.
thanks,
bp

