From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id AC533BC8E for ; Wed, 4 May 2005 01:57:52 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j43Nvqc3004166 for ; Wed, 4 May 2005 01:57:52 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA01537 for ; Wed, 4 May 2005 01:57:51 +0200 (MET DST) Received: from vapor.isi.edu (vapor.isi.edu [128.9.64.64]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j43NvoA2016152 for ; Wed, 4 May 2005 01:57:51 +0200 Received: from albini.isi.edu (albini.isi.edu [128.9.216.111]) by vapor.isi.edu (8.11.6p2+0917/8.11.2) with ESMTP id j43NufI20866; Tue, 3 May 2005 16:56:41 -0700 (PDT) Date: Tue, 3 May 2005 16:56:41 -0700 (PDT) From: Hal Daume III To: Eliot Handelman Cc: caml Subject: Re: [Caml-list] regexp bug? In-Reply-To: <4278377F.30502@generation.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-ISI-4-39-6-MailScanner: Found to be clean X-MailScanner-From: hdaume@isi.edu X-Miltered: at nez-perce with ID 42781000.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42780FFE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 regexp:01 bug:01 ord:01 ord:01 regexp:01 caml-list:01 beginner's:01 ocaml:01 beginners:01 bug:01 wrote:01 matched:01 bin:01 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: 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