caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hal Daume III <hdaume@ISI.EDU>
To: Eliot Handelman <eliot@generation.net>
Cc: caml <caml-list@inria.fr>
Subject: Re: [Caml-list] regexp bug?
Date: Tue, 3 May 2005 16:56:41 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0505031654420.14367-100000@albini.isi.edu> (raw)
In-Reply-To: <4278377F.30502@generation.net>

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:

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

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


  reply	other threads:[~2005-05-03 23:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-04  2:46 Eliot Handelman
2005-05-03 23:56 ` Hal Daume III [this message]
2005-05-04  5:48   ` [Caml-list] " Eliot Handelman
2005-05-04  2:31 ` Jason Hickey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44.0505031654420.14367-100000@albini.isi.edu \
    --to=hdaume@isi.edu \
    --cc=caml-list@inria.fr \
    --cc=eliot@generation.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).