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 KAA03313; Fri, 23 May 2003 10:36:24 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA03344 for ; Fri, 23 May 2003 10:36:23 +0200 (MET DST) Received: from carme.keymachine.de (h-62.141.48.121.keyweb.de [62.141.48.121] (may be forged)) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4N8aNH29325 for ; Fri, 23 May 2003 10:36:23 +0200 (MET DST) Received: from kunz.ratzer (dclient217-162-174-4.hispeed.ch [217.162.174.4]) by carme.keymachine.de (8.11.6/8.11.6) with ESMTP id h4N8aMq03396 for ; Fri, 23 May 2003 10:36:22 +0200 Received: from stefan by kunz.ratzer with local (Exim 3.35 #1 (Debian)) id 19J82I-0000Ox-00 for ; Fri, 23 May 2003 10:36:22 +0200 Date: Fri, 23 May 2003 10:36:22 +0200 From: Stefan Heimann To: caml-list@inria.fr Subject: Re: Re: [Caml-list] ocamllex, regular expression syntax Message-ID: <20030523083622.GB1307@kunz.ratzer> Mail-Followup-To: caml-list@inria.fr References: <20030522205632.GA2130@kunz.ratzer> <20030522230424.GA21973@opus.davidb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030522230424.GA21973@opus.davidb.org> User-Agent: Mutt/1.3.28i X-Spam: no; 0.00; caml-list:01 regexps:01 0700,:01 0200,:01 readable:01 syntax:02 whitespace:02 clearer:02 wrote:03 perl:03 ocamllex:05 cvs:05 'x':07 mode:07 difficult:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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