caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Tom Ridge <tom.j.ridge+list@googlemail.com>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] ocaml-re library, partial match semantics
Date: Tue, 30 Sep 2014 13:35:18 +0100	[thread overview]
Message-ID: <CABooLwOYnSMYf2cuw2x3i4nwbhjKPw9gHduqdcAGFf87OsNddQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1042 bytes --]

             reply	other threads:[~2014-09-30 12:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30 12:35 Tom Ridge [this message]
2014-10-01 11:53 ` Jérôme Vouillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABooLwOYnSMYf2cuw2x3i4nwbhjKPw9gHduqdcAGFf87OsNddQ@mail.gmail.com \
    --to=tom.j.ridge+list@googlemail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).