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 WAA21010; Thu, 22 May 2003 22:56:33 +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 WAA21078 for ; Thu, 22 May 2003 22:56:32 +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 h4MKuVH29166 for ; Thu, 22 May 2003 22:56:31 +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 h4MKuVY20983 for ; Thu, 22 May 2003 22:56:31 +0200 Received: from stefan by kunz.ratzer with local (Exim 3.35 #1 (Debian)) id 19Ix73-0000Yr-00 for ; Thu, 22 May 2003 22:56:33 +0200 Date: Thu, 22 May 2003 22:56:33 +0200 From: Stefan Heimann To: caml-list@inria.fr Subject: [Caml-list] ocamllex, regular expression syntax Message-ID: <20030522205632.GA2130@kunz.ratzer> Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam: no; 0.00; caml-like:01 ocaml:01 syntax:02 harder:02 arbitrary:02 module:03 lex:04 wondering:04 seems:05 str:05 news:94 ocamllex:05 cvs:05 matched:07 difficult:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, [sorry if this posting appears twice. I first submitted it with my news client. It seems not to appear on the mailing list and so I decided to post it again] I new to ocaml and today I played a little bit around with ocamllex. Now I'm wondering why ocamllex has this strange regular expression syntax. One has to quoted every character, an arbitrary character is matched by the underscore... The manual for ocamllex says: "The regular expressions are in the style of lex, with a more Caml-like syntax." But the regular expression syntax in the Str module looks "normal" to me. Regular expressions like this "[^"\\]*(\\.[^"\\]*)*" are not easy to read, but with the ocamllex syntax it is even more difficult: '"'[^'"''\\']*('\\'_[^'"''\\']*)*'"' (and harder to write). Is this just for historical reason or is there a practical reason for this syntax? I'm just curious... 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