<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/01/507496d13f3e4adba7d2906519ff3b92"
  from="Dmitry Bely &lt;dbely@m...&gt;"
  author="Dmitry Bely"
  date="2003-01-07T15:57:35"
  subject="Re: [Caml-list] Str Shortest Match"
  prev="2003/01/7fee1b5b613aa3d71ce448d60403241e"
  next="2003/01/3e3525568cadacef5d886bb7c9a1f04f"
  prev-in-thread="2003/01/e9e72506fe148ff92fd206c8a7f7d289"
  prev-thread="2003/01/8822d3df66a08ab1cf8eb00f8fdaf3de"
  next-thread="2003/01/32194e76dab123b9278d338986be0996"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Str Shortest Match">
<msg 
  url="2003/01/e9e72506fe148ff92fd206c8a7f7d289"
  from="Nicolas Cannasse &lt;warplayer@f...&gt;"
  author="Nicolas Cannasse"
  date="2003-01-05T03:26:27"
  subject="[Caml-list] Str Shortest Match">
<msg 
  url="2003/01/507496d13f3e4adba7d2906519ff3b92"
  from="Dmitry Bely &lt;dbely@m...&gt;"
  author="Dmitry Bely"
  date="2003-01-07T15:57:35"
  subject="Re: [Caml-list] Str Shortest Match">
</msg>
</msg>
</thread>

<contents>
"Nicolas Cannasse" &lt;warplayer@free.fr&gt; writes:

&gt; Is there a way to do a shortest regular expression matching using Str ?
&gt; In Perl and many RE engines, this is done by using  .*? but it does not
&gt; seems to work on Str.
&gt;
&gt; let s = "yayybyyb" in
&gt; let r = Str.regexp "a\(.*?\)b" in
&gt; Str.search_forward r s 0;
&gt; Str.matched_group 1 s;
&gt;
&gt; =&gt; "yybyy" instead of "yy"

Why not to use Pcre module then?

- Dmitry Bely


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

