I tried to create a Regular expression. To validate a city that must start with “apo” or “fpo”.
Without or with space and dot in between “a.p.o” or “Apo”, “APO”. I tried this:
^(APO)?|(apo)?\s*\.\w
but it won’t work for me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C# .NET
Use
IsMatchwithRegexOptions.IgnoreCase. The regex:Objective-C
You can use
- (NSTextCheckingResult *)firstMatchInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)rangemethod to check for the first match. If not found then failure. The regex: