From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 55D09BB84 for ; Mon, 12 Jan 2009 16:49:26 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.37,253,1231110000"; d="scan'208";a="22352065" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Jan 2009 16:49:26 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id n0CFnPqr031775 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 12 Jan 2009 16:49:26 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgCADz1aklQW+UCe2dsb2JhbACUEwEBFiIEs1GFGoVGhW8 X-IronPort-AV: E=Sophos;i="4.37,253,1231110000"; d="scan'208";a="19483932" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 12 Jan 2009 16:49:24 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LMP2a-0005fz-Dj for caml-list@inria.fr; Mon, 12 Jan 2009 15:49:24 +0000 Received: from cpe-72-229-116-34.nyc.res.rr.com ([72.229.116.34]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 15:49:24 +0000 Received: from cconway by cpe-72-229-116-34.nyc.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 15:49:24 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Chris Conway Subject: Re: Regular expression matching against OCaml streams. Date: Mon, 12 Jan 2009 15:49:16 +0000 (UTC) Message-ID: References: <496B3EE9.3020001@tepkom.ru> <496B54DF.7080303@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 72.229.116.34 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5) Sender: news X-Miltered: at concorde with ID 496B6685.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocam:01 edgar:98 wrote:01 regex:01 terminate:01 writes:01 strings:01 expression:02 match:02 match:02 library:03 stream:04 stream:04 expressions:04 Edgar Friendly gmail.com> writes: > > Dmitri Boulytchev wrote: > > Hello, > > > > is it possible to match OCam streams (by mean of Stream.t) against > > regular expressions? Are there library > > that can be used for this purpose? Str matches only against strings. > > I don't know of any libraries for this purpose. I will warn anyone > making one that it's easy for simple regex matching to evaluate the > whole stream, and then fail to match. Or worse, never terminate. E.g., stream_match "a*b" (Stream.from (fun _ -> Some 'a')) Regards, Chris