Re: Detect phone number in NSString

2008-04-16 Thread Graham Davison
On 16 Apr 2008, at 11:53, Uli Kusterer wrote: Am 16.04.2008 um 10:47 schrieb Brad Peterson: So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444-555-6767 is a phone number and should be marked as such.

Re: Detect phone number in NSString

2008-04-16 Thread Mike Wright
On 16 Apr 2008 09:40:46 -0600, Dave DeLong" <[EMAIL PROTECTED]> wrote: (Guess I have to keep top posting.) If you're only concerned with US phone numbers, about a half-dozen canned patterns should suffice. However, if you need to deal with phone numbers in places like Australia, Japan, and

Re: Detect phone number in NSString

2008-04-16 Thread Uli Kusterer
Am 16.04.2008 um 10:47 schrieb Brad Peterson: So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444-555-6767 is a phone number and should be marked as such. Apple has this in Mail. No idea whether there

Re: Detect phone number in NSString

2008-04-16 Thread Dave DeLong
The thing that first comes to mind would be to use regular expressions. CocoaDev has a good page listing where you could find some Regex frameworks: http://www.cocoadev.com/index.pl?RegularExpressions Then you'd run your string through a matcher while looking for the phone number pattern. You co

Detect phone number in NSString

2008-04-16 Thread Brad Peterson
Hi all, Like many cell phones are doing these days, I want to be able to detect phone numbers in NSStrings and highlight them in some way for the user. So, if I had some text, say : "Hi Tom, Please call Cheryl at 444-555-6767 and she can get you that info..." I want to be able to "know" that 444