From: "Jake Donham" <jake.donham@skydeck.com>
To: caml-list@yquem.inria.fr
Subject: Re: ocamllex regexp problem
Date: Wed, 19 Mar 2008 09:39:41 -0700 [thread overview]
Message-ID: <c7e4e9f0803190939o2d916af2y11535fc2209c0a17@mail.gmail.com> (raw)
In-Reply-To: <c7e4e9f0803181903p49ab284h8ad74e8021be2ccd@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]
On Tue, Mar 18, 2008 at 7:03 PM, Jake Donham <jake.donham@skydeck.com>
wrote:
> let ends_sq = [^']']* ']'
> let ends_sq_sq = ends_sq ([^']'] ends_sq)* ']'+
> let ends_sq_sq_ang = ends_sq_sq ([^'>'] ends_sq_sq)* '>'
My colleague Haoyang Wang points out that my regexp, when viewed
nondeterministically, matches "foo]]]>bar]]>", since ']'+ may match only
"]]", then [^'>'] matches the third "]". Changing it to [^'>'']'] repairs
it. So I guess the answer is that Micmatch on PCRE treats the regexp as
greedy, while ocamllex does not.
Thanks to those who replied,
Jake
[-- Attachment #2: Type: text/html, Size: 981 bytes --]
prev parent reply other threads:[~2008-03-19 16:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-19 2:03 Jake Donham
2008-03-19 9:00 ` [Caml-list] " Michael Wohlwend
2008-03-19 15:21 ` Martin Jambon
2008-03-19 16:39 ` Jake Donham [this message]
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=c7e4e9f0803190939o2d916af2y11535fc2209c0a17@mail.gmail.com \
--to=jake.donham@skydeck.com \
--cc=caml-list@yquem.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