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