<?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="2005/05/6b04d7fc06df9f60408dca2680cb0501"
  from="Hal Daume III &lt;hdaume@I...&gt;"
  author="Hal Daume III"
  date="2005-05-03T23:57:52"
  subject="Re: [Caml-list] regexp bug?"
  prev="2005/05/eb071e51b74168a16837e0b94c090d7a"
  next="2005/05/ba470fc2e7e38c9ca3b3647f712ed279"
  prev-in-thread="2005/05/eb071e51b74168a16837e0b94c090d7a"
  next-in-thread="2005/05/81d5e441fedb0cc10a31a8d898ce6284"
  prev-thread="2005/05/b08ba41a8af39c81581e67c0615afd28"
  next-thread="2005/05/ed27a45e7c68868f7f6178d7f035d421"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="regexp bug?">
<msg 
  url="2005/05/eb071e51b74168a16837e0b94c090d7a"
  from="Eliot Handelman &lt;eliot@g...&gt;"
  author="Eliot Handelman"
  date="2005-05-03T23:44:27"
  subject="regexp bug?">
<msg 
  url="2005/05/6b04d7fc06df9f60408dca2680cb0501"
  from="Hal Daume III &lt;hdaume@I...&gt;"
  author="Hal Daume III"
  date="2005-05-03T23:57:52"
  subject="Re: [Caml-list] regexp bug?">
<msg 
  url="2005/05/81d5e441fedb0cc10a31a8d898ce6284"
  from="Eliot Handelman &lt;eliot@g...&gt;"
  author="Eliot Handelman"
  date="2005-05-04T02:46:24"
  subject="Re: [Caml-list] regexp bug?">
</msg>
</msg>
<msg 
  url="2005/05/ba470fc2e7e38c9ca3b3647f712ed279"
  from="Jason Hickey &lt;jyh@c...&gt;"
  author="Jason Hickey"
  date="2005-05-04T02:31:15"
  subject="Re: [Caml-list] regexp bug?">
</msg>
</msg>
</thread>

<contents>
Why not?  ord('_') is 95, which is between ord('A') = 65 and ord('z'), 
which is 122.  OTOH, it is not between ord('A') = 65 and ord('Z') = 90 OR 
ord('a') = 97 and ord('z') = 122.

the first regexp matches anything in the set
  {a} union {Z} union {everything between A and z}

while the second matches anything in the set
  {everything between a and z} union {everything between A and Z}

On Tue, 3 May 2005, Eliot Handelman wrote:

&gt; This doesn't seem right:
&gt; 
&gt; 
&gt;         Objective Caml version 3.08.0
&gt; open Str
&gt; 
&gt; let search r str =
&gt;   search_forward (regexp r) str 0;
&gt;   matched_string str;;
&gt;  
&gt; # search "[aA-zZ]+" "_test";;
&gt; - : string = "_test"
&gt; 
&gt; whereas:
&gt; 
&gt; # search "[a-zA-Z]+" "_test";;
&gt; - : string = "test"
&gt; 
&gt; 
&gt; -- eliot
&gt; 
&gt; _______________________________________________
&gt; Caml-list mailing list. Subscription management:
&gt; http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
&gt; Archives: http://caml.inria.fr
&gt; Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
&gt; Bug reports: http://caml.inria.fr/bin/caml-bugs
&gt; 

-- 
 Hal Daume III                                   | hdaume@isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

</contents>

</message>

