From: Sebastien Ferre <ferre@irisa.fr>
To: caml-list@yquem.inria.fr
Cc: colonna@ccr.jussieu.fr
Subject: Re: [Caml-list] About the O'Reilly book on the web
Date: Mon, 27 Nov 2006 10:07:10 +0100 [thread overview]
Message-ID: <456AAABE.5020405@irisa.fr> (raw)
In-Reply-To: <45688DAE.7010309@ccr.jussieu.fr>
Hello,
Francois Colonna wrote:
> Hello
>
> in the version of the O'Reilly book on the web
> http://caml.inria.fr/pub/docs/oreilly-book/html/book-ora105.html#toc134
>
> Chapter 11 about Str Library page 293
>
> the followin example of a regular expression is given :
>
> *let*| |english_date_format| ||=|| |Str.regexp|
> ||"[0-9]+\.[0-9]+\.[0-9]+"|| |;;
There should be a double backslash \\.
Indeed \ is a meta-chararcter of regular expressions, but also
of usual strings.
In general, all backslashes in regular expressions must be
doubled when represented as caml strings. For instance, the
same happens with groupings :
the regular expression : \([0-9]+\),\1
is represented by
let re = Str.regexp "\\([0-9]+\\),\\1"
Hope it helps,
Sebastien
next prev parent reply other threads:[~2006-11-27 9:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-25 18:38 Francois Colonna
2006-11-27 9:07 ` Sebastien Ferre [this message]
2006-11-28 21:01 ` [Caml-list] " Philippe Wang
2006-11-28 22:33 ` Till Varoquaux
2006-11-28 22:47 ` Martin Jambon
2006-11-29 0:18 ` Philippe Wang
2006-11-29 1:48 ` Martin Jambon
2006-11-29 15:26 ` Philippe Wang
2006-11-29 17:52 ` Diego Olivier FERNANDEZ PONS
2006-11-29 17:25 ` brogoff
2006-11-29 18:10 ` Philippe Wang
2006-11-30 2:30 ` skaller
2006-11-30 18:20 ` Tom
2006-12-01 3:21 ` skaller
2006-12-01 6:48 ` Tom
2006-11-29 21:20 ` Jon Harrop
2006-11-29 21:25 ` Till Varoquaux
2006-12-01 0:12 ` brogoff
2006-11-28 23:07 ` Philippe Wang
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=456AAABE.5020405@irisa.fr \
--to=ferre@irisa.fr \
--cc=caml-list@yquem.inria.fr \
--cc=colonna@ccr.jussieu.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