<div dir="ltr"><div>wouldn't just writing <date>.*?</date> get me 'week after'?<br><br></div>I really can do everything I need with regular expressions. The question is more about what is easier in the long run. Some times I feel I'm writing too many 'for's and 'if's...<br>
<div><div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-30 18:16 GMT+02:00 maxwell <span dir="ltr"><<a href="mailto:maxwell@umiacs.umd.edu" target="_blank">maxwell@umiacs.umd.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2014-06-30 10:13, Darren Cook wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
E.g. if your document looks like this, I'd rather use a regex to find<br>
the proper nouns:<br>
<br>
  I am off to <place>London</place> <date>tomorrow</date>, and then<br>
<place>Cambridge</place> with <person>Mary</person> the <date>week<br>
after</date>.<br>
</blockquote>
<br></div>
But if you wanted to find all the <date>...</date> elements, and the line breaks are as shown, a regex by itself isn't going to work (in particular, it won't find 'week after').  You need a parser, or else you need to do some normalization of the XML (making sure line breaks don't occur inside the XML elements of interest).  And if you're going to normalize the XML anyway, you might be better off using an XML parser in the first place.<br>

<br>
   Mike Maxwell<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
UNSUBSCRIBE from this page: <a href="http://mailman.uib.no/options/corpora" target="_blank">http://mailman.uib.no/options/<u></u>corpora</a><br>
Corpora mailing list<br>
<a href="mailto:Corpora@uib.no" target="_blank">Corpora@uib.no</a><br>
<a href="http://mailman.uib.no/listinfo/corpora" target="_blank">http://mailman.uib.no/<u></u>listinfo/corpora</a><br>
</div></div></blockquote></div><br></div></div></div></div>