ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Five Habits for Successful Regular Expressions
Subject:   more appropriately ...
Date:   2003-08-29 12:31:01
From:   anonymous2
Response to: US phone numbers

Not to take away from the main point of the article; it's an ugly practical problem I've dealt with in the past and I wanted to point out another option. Re-stated in the context of the article, please replace the appropriate line in my last post with:

if ($phone =~ m/^ # beginning of string
(\d{3})? # maybe an area code
(\d{7}) # definitely 7 digits
$ # end of string
/x) {

Krishna Sethuraman

1 to 1 of 1
1 to 1 of 1