I have a very big NSString, which holds around 1500 characters in it. In this string I need to extract a phone number, which may change frequently, as it is a dynamic data. The phone number will be in the format of 251-221-2000, how can I extract this?
I have a very big NSString , which holds around 1500 characters in it.
Share
Check out this previous question on regular expressions and
NSString.Search through NSString using Regular Expression
In your case an appropriate regular expression would be
@"\\d{3}-\\d{3}-\\d{4}".