From: skaller <sk...@us...> - 2004-09-11 00:36:17
|
On Sat, 2004-09-11 at 04:50, Jesse Guardiani wrote: > Richard Jones wrote: > > > (Repost: original was apparently tagged as sp*m). > > > > Not really sure I understand it from a user's point of view. > > > > For me what really matters is that I could write something like: > > > > if string =~ /(a+)(b*)/ then ... > > > > The regular expression (Perl-compatible, please!) ought to be compiled > > and checked at compile time, and the compiler should handle caching > > compiled expressions containing variables. > > That would certainly be nice. Felix actually uses a syntax like this: open Lexer; regexp digit = ["0123456789"]; regexp digits3 = digit digit digit; regexp digits4 = digits3 digit; regexp area_code = digits3 | "(" digits3 ")"; regexp exchange = digits3; regexp phone = area_code " " exchange (" " | "-") digits4; reglex start to finish with | phone => .... | _ => "" endmatch which is an excerpt from the Bagley Shootout test. -- John Skaller, mailto:sk...@us... voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net |