<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Eliot,<br>
<br>
The ? operator makes it a lazy match (first best match) instead of a
greedy match (longest possible match).<br>
Without the ? operator the expression is greedy and will match a lot
more content than expected.<br>
<br>
You can use either (.|\n)*? or .*? with "dot matches all", but in
either case the ? operator is the one that limits the search to the
first best match.<br>
<br>
Regards,<br>
Adrian<br>
<br>
<pre class="moz-signature" cols="72">Adrian Buza
oXygen XML Editor and Author Support
Tel: +1-650-352-1250 ext.202
Fax: +40-251-461482
<a class="moz-txt-link-abbreviated" href="mailto:support@oxygenxml.com">support@oxygenxml.com</a>
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com">http://www.oxygenxml.com</a></pre>
<br>
<br>
<div class="moz-cite-prefix">On 11.01.2014 23:24, Eliot Kimber
wrote:<br>
</div>
<blockquote cite="mid:CEF71254.203D0%25ekimber@reallysi.com"
type="cite">
<pre wrap="">That works. But here’s another question: why is the outer group with the ?
operator required? I tried just (.|\n)*, which should match anything
between my start and end strings, but it does not, where ((.|\n)*?) does.
Thanks,
E.
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
oXygen-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:oXygen-user@oxygenxml.com">oXygen-user@oxygenxml.com</a>
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com/mailman/listinfo/oxygen-user">http://www.oxygenxml.com/mailman/listinfo/oxygen-user</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>