From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 60C69BBAF for ; Mon, 6 Dec 2010 14:11:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApAFALJv/ExQW+UMgWdsb2JhbACVIo4UFQEBFiIivHWFSQSKbg X-IronPort-AV: E=Sophos;i="4.59,305,1288566000"; d="scan'208";a="91614749" Received: from lo.gmane.org ([80.91.229.12]) by mail1-smtp-roc.national.inria.fr with ESMTP; 06 Dec 2010 14:11:44 +0100 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PPar1-0000A2-6a for caml-list@inria.fr; Mon, 06 Dec 2010 14:11:43 +0100 Received: from avelizy-155-1-50-177.w86-217.abo.wanadoo.fr ([86.217.25.177]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Dec 2010 14:11:43 +0100 Received: from sylvain by avelizy-155-1-50-177.w86-217.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Dec 2010 14:11:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: help with regular expression Date: Mon, 6 Dec 2010 13:11:29 +0000 (UTC) Message-ID: References: <926418.88102.qm@web65410.mail.ac4.yahoo.com> X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: avelizy-155-1-50-177.w86-217.abo.wanadoo.fr User-Agent: slrn/pre1.0.0-18 (Linux) X-Spam: no; 0.00; le-gall:01 regexp:01 pcre-ocaml:01 syntax:01 regexp:01 syntax:01 eol:01 pcre:01 wrote:01 wrote:01 jambon:01 jambon:01 expression:02 match:02 meaningful:04 On 06-12-2010, David Allsopp wrote: > zaid Khalid wrote: >> > >> Hint I am using (Str.regexp) > > There are other libraries (e.g. pcre-ocaml) which provide different (I > would say more powerful, rather than strictly better!) > implementations. > > There is also syntax extension like mikmatch, that helps to write regexp in a very meaningful syntax: match str with | RE bol "a"* | "ab"* eol -> true | _ -> false http://martin.jambon.free.fr/mikmatch-manual.html http://martin.jambon.free.fr/mikmatch.html You can use pcre and str with mikmatch. Regards, Sylvain Le Gall