Browse thread
[Caml-list] ocamllex, regular expression syntax
-
Stefan Heimann
- John Max Skaller
-
David Brown
- Stefan Heimann
- Pierre Weis
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Stefan Heimann <lists@s...> |
| Subject: | Re: Re: [Caml-list] ocamllex, regular expression syntax |
On Thu, May 22, 2003 at 04:04:24PM -0700, David Brown wrote:
> On Thu, May 22, 2003 at 10:56:33PM +0200, Stefan Heimann wrote:
>
> > "[^"\\]*(\\.[^"\\]*)*"
> >
> > are not easy to read, but with the ocamllex syntax it is even more
> > difficult:
> >
> > '"'[^'"''\\']*('\\'_[^'"''\\']*)*'"'
>
> But don't you find:
>
> '"' [^ '"' '\\' ]* ( '\\' _ [^ '"' '\\']* )*
>
> easier to read. I certainly do.
For me there is too much "noise" in the regular expression. All the
single quotes do not have a meaning, the just say "this is a
character". But I know that " or x is a character, I don't think
writing '"' or 'x' makes this fact clearer.
> Perl even has a mode where whitespace can be inserted into regexps to
> make them more readable.
That's right, but you don't have to use single quotes around every
character.
Bye,
Stefan
--
Stefan Heimann
http://www.stefanheimann.net :: personal website.
http://cvsshell.sf.net :: CvsShell, a console based cvs client.
-------------------
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