From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8355FD169 for ; Mon, 25 Jul 2005 04:16:04 +0200 (CEST) Received: from web30510.mail.mud.yahoo.com (web30510.mail.mud.yahoo.com [68.142.200.123]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id j6P2G39E012738 for ; Mon, 25 Jul 2005 04:16:04 +0200 Received: (qmail 10174 invoked by uid 60001); 25 Jul 2005 02:16:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LFPXxJo4eKvk9+c1fPKBE3oQov/jnRVxP9xrX7ALH4g89YjEiM5LDi3uXZ2Dln/9K33oVLuWsdHhGkDlBdxtbVC/F2LgaFXzFsq+hJ4QUaBqlsJvjEigNKcIOd4STJdoIFCuY19SBDikqtQh9YjeMmjvxdp/qDqeoSSGjgArRQo= ; Message-ID: <20050725021603.10172.qmail@web30510.mail.mud.yahoo.com> Received: from [69.129.110.8] by web30510.mail.mud.yahoo.com via HTTP; Sun, 24 Jul 2005 19:16:02 PDT Date: Sun, 24 Jul 2005 19:16:02 -0700 (PDT) From: David Thomas Subject: Re: Text.get/Text.search in labltk To: caml-list@yquem.inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 42E44B63.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; labltk:01 char:01 rec:01 regexp:01 char:01 printf:01 printf:01 wrote:01 a-za-z:02 match:02 pattern:03 let:03 problem:05 coordinates:06 rather:07 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=FORGED_YAHOO_RCVD autolearn=disabled version=3.0.3 Ah, I found the problem. `Atxy is looking for display coordinates, rather than (line, char). --- David Thomas wrote: > Whoops. > > The l+1 was an earlier experiment that hadn't been > removed. It works the same whether it is there or > not. > > > > The code: > > let rec printwords () = > > match Text.search > > ~switches:[`Regexp] > > ~pattern:"[a-zA-Z]" > > ~start:(`Atxy (0, 0), [`Wordend; > > `Char > > 1]) > > text > > with `Linechar (l, c) -> > > Printf.printf "(%d, %d) -> %s\n%!" > > l c > > (Text.get > > ~start:(`Atxy > (l+1, > > c), []) > > ~stop:(`Atxy (l, > c), > > [`Lineend]) > > text > > );; > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com