From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA19397; Thu, 15 Jan 2004 17:20:10 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA17136 for ; Thu, 15 Jan 2004 17:20:09 +0100 (MET) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0FGK8520496 for ; Thu, 15 Jan 2004 17:20:08 +0100 (MET) Received: from fichte.ai.univie.ac.at (markus@localhost [127.0.0.1]) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) with ESMTP id i0FGJiHn013968; Thu, 15 Jan 2004 17:19:44 +0100 Received: (from markus@localhost) by fichte.ai.univie.ac.at (8.12.3/8.12.3/Debian-6.6) id i0FGJiV2013967; Thu, 15 Jan 2004 17:19:44 +0100 Date: Thu, 15 Jan 2004 17:19:44 +0100 From: Markus Mottl To: Richard Jones Cc: Frederic van der Plancke , caml-list@inria.fr Subject: Re: [Caml-list] ANNOUNCE: mod_caml 1.0.6 - includes security patch Message-ID: <20040115161943.GB9541@fichte.ai.univie.ac.at> Mail-Followup-To: Richard Jones , Frederic van der Plancke , caml-list@inria.fr References: <20040115140324.GA3047@redhat.com> <4006AC01.F2AD2741@decis.be> <20040115154211.GA8340@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040115154211.GA8340@redhat.com> User-Agent: Mutt/1.4.1i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 plancke:01 pcre:01 pcre:01 subst:01 regexp:01 regexp:01 caml:01 patch:02 mottl:02 mottl:02 wrote:03 wrote:03 awful:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 15 Jan 2004, Richard Jones wrote: > On Thu, Jan 15, 2004 at 04:04:33PM +0100, Frederic van der Plancke wrote: > > > + let re2 = Pcre.regexp "\\\\" in (* Double up any backslashes. *) > > > + let sub2 = Pcre.subst "\\\\" in > > > > This does not look right: why sub2 = re2 and not sub2 = re2 ^ re2 ? > > No, it seems to be right. > > PCRE doesn't using \ escaping in substitutions, only in regular > expressions. So the re2 matches \ and sub2 substitutes \\. Richard is right here: I know it looks awful, but the four backslashes in the regexp pattern for re2 indeed only stand for one. They have to be escaped in the OCaml-string and also for PCRE again, i.e. twice. Substitution patterns use the $-sign for escaping - therefore escaping only needs to be done once. Regards, Markus -- Markus Mottl http://www.oefai.at/~markus markus@oefai.at ------------------- 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