From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 104E27EFCD for ; Tue, 30 Sep 2014 14:44:00 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.216.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.216.53 as permitted sender) identity=mailfrom; client-ip=209.85.216.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qa0-f53.google.com) identity=helo; client-ip=209.85.216.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-qa0-f53.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AugBACSlKlTRVdg1m2dsb2JhbABgg2FXBIJ+gRzGBYdRgQoIFgERAQEBAQEGCwsJFCyEHBEdAQE4EA4BBjcCJBIBBQEiGxqIBwEDEZ0aboo4eIUCAQWJDwoZJw2HMAIEkBqDA4FTliqHCpN+GCmBbIMpPC+CSgEBAQ X-IPAS-Result: AugBACSlKlTRVdg1m2dsb2JhbABgg2FXBIJ+gRzGBYdRgQoIFgERAQEBAQEGCwsJFCyEHBEdAQE4EA4BBjcCJBIBBQEiGxqIBwEDEZ0aboo4eIUCAQWJDwoZJw2HMAIEkBqDA4FTliqHCpN+GCmBbIMpPC+CSgEBAQ X-IronPort-AV: E=Sophos;i="5.04,626,1406584800"; d="scan'208";a="98626712" Received: from mail-qa0-f53.google.com ([209.85.216.53]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Sep 2014 14:43:59 +0200 Received: by mail-qa0-f53.google.com with SMTP id v10so1110909qac.12 for ; Tue, 30 Sep 2014 05:43:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=fAHBqJQK8uHOthWaC0nmXBAivWWCXljuYLu6n4laWPs=; b=x4hAPxUbpmYrFOmvP8NIw4tj7m4xbfPnhGz42E46YqPc+l1vqesz4MDwj5rFfWImJ7 GJwnpH0Oks9G2t/aZih4m6wIAlCfQRudwffapQjbLbN4G4KctrwraGro3o11fxtj5Z5K xCZGJ9ibGp9uGe9dNMVca6MRSp8aLW2crsJrZRdtXcOlHGxOEHFZWNJ82z3RsL/8jCQH jw4rh1ShSBlVRhMRrMHi13/ISkfHGy1O3Vh/WM4Q0XAPXXAo1cXE1nlj8r0B+mAs3M5Y a0vGJmNID/X3ctIPte7KhNzFt264SKiS7WSEybyK3qAG9hnh+OTXCNTh6T6nGaT5Bvhb VvmQ== X-Received: by 10.224.74.134 with SMTP id u6mr17676032qaj.71.1412080538475; Tue, 30 Sep 2014 05:35:38 -0700 (PDT) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.140.156.3 with HTTP; Tue, 30 Sep 2014 05:35:18 -0700 (PDT) From: Tom Ridge Date: Tue, 30 Sep 2014 13:35:18 +0100 X-Google-Sender-Auth: ujB2LrvzemN0ZnWxGFx4Oeqdrbg Message-ID: To: caml-list Content-Type: multipart/alternative; boundary=089e0158bac4e3fcd80504479e10 Subject: [Caml-list] ocaml-re library, partial match semantics --089e0158bac4e3fcd80504479e10 Content-Type: text/plain; charset=UTF-8 Dear All, I am using the ocaml-re library https://github.com/ocaml/ocaml-re I have the following code: open Re; let a = char 'a' let b = char 'b' let re = seq[a;b] |> compile let rs = exec re "caba" let [|(1,3)|] = get_all_ofs rs let true = execp re "cab" let _ = assert (exec_partial re "a" = `Mismatch) I was expecting that the exec_partial in the final line would return `Partial, indicating that a prefix of a match was found. However, a `Mismatch was returned instead. What is the meaning/behaviour of exec_partial? Can I use it to perform a partial match? Thanks Tom --089e0158bac4e3fcd80504479e10 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear All,

I am using the ocaml-re libra= ry


I have th= e following code:

open Re;

let a =3D char 'a'
let b =3D char 'b'

let re =3D seq[a;b] |> compile

=
let rs =3D exec re "caba"

let [|(1,= 3)|] =3D get_all_ofs rs

let true =3D execp re &quo= t;cab"

let _ =3D assert (exec_partial re &quo= t;a" =3D `Mismatch)

I was expecting tha= t the exec_partial in the final line would return `Partial, indicating that= a prefix of a match was found. However, a `Mismatch was returned instead. = What is the meaning/behaviour of exec_partial? Can I use it to perform a pa= rtial match?

Thanks

Tom
--089e0158bac4e3fcd80504479e10--