Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Perl is to stupid to understand this 1 liner.

From: doncox:enterprise at: 18-Dec-2001 11:29

On 18-Dec-01, Joel Neely wrote:
> That's an interesting (although severely non-trivial) approach to > the development issue, but I was describing a property of the > problem space itself. Using myself as a case in point, I made up > a list of the ways I've actually seen US phone numbers written or > typed/typeset: > > 551-1211 > 800-552-1212 > 1-800-553-1213 > 1+800-554-1214 > 800/555-1215 > (800)556-1216 > (800) 557-1217 > 800.558.1218 > 1.800.559.1219
The rule here seems to be "a set of from 2 to 4 strings of 1 to 4 digits, delimited by +, -, (, ), /, . or "ext or EXT". I guess the first thing is to look for any string of 8 to 24 characters containing only the above characters and spaces. The first character must be a digit or (, so you can use them as a trigger to start examining the next few characters. The false positives are a problem as a product code might be formatted exactly like a phone number, especially like your first example. My phone number is 44-1642-881220 Regards -- Don Cox [doncox--enterprise--net]