caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Match order of Str regexps
@ 2004-08-19 17:24 Martin Jambon
  0 siblings, 0 replies; only message in thread
From: Martin Jambon @ 2004-08-19 17:24 UTC (permalink / raw)
  To: caml-list

Hello,

Would it be possible to consider that:
  1. the regular expressions in the Str library are matched in a greedy
     fashion (longest match, left to right),
  2. that the regexps of an alternative are tried from left to right?

Illustration of case 1 (micmatch/ocamllex syntax):

# match "abc" with RE (_* as s1) (_* as s2) -> (s1, s2);;
- : string * string = ("abc", "")

Illustration of case 2:

# match "ab" with RE "a" | "ab" as s -> s;;
- : string = "a"


Martin

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-19 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-19 17:24 [Caml-list] Match order of Str regexps Martin Jambon

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).