From: Daniel Berger Date: 2003-04-17T07:45:54+09:00 Subject: Re: regular expressions Daniel Berger wrote: > > "Hal E. Fulton" wrote: > > > > > But there is a complexity threshold where I would > > rather have a more verbose, readable, multi-line > > notation. > > FWIW, there's always the /x option: > > phoneregex = / > ^ # Beginning of string > \d{3,} # starts with three digits > \-* # ...followed by an optional dash > \d{3,} # ...followed by three more digits > \-* # ...followed by an optional dash > \d{4,} # ...follwed by four digits > $ # end of string > /x Oops. Should be: phoneregex = / ^ # Beginning of string \d{3,3} # starts with three digits \-* # ...followed by an optional dash \d{3,3} # ...followed by three more digits \-* # ...followed by an optional dash \d{4,4} # ...followed by four digits $ # end of string /x Well, anyway, you get the idea. Dan