I’m trying to create a regular expression that matches when the string starts with 1 or more alpha characters followed by exactly 1 ? and ending with 1 or more alpha characters
What I have so far is
[A-Za-z]+\?{1}[A-Za-z]+
but this is causing my program to crash. Any ideas? Thanks for any responses.
UPDATED
Here is the exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
'Can't do regex matching, reason: (Can't open pattern U_REGEX_RULE_SYNTAX
(string fe?ing, pattern [A-Za-z]+?{1}[A-Za-z]+, case 0, canon 0))'
Seems to be ignoring the escape character for the ?
That does look right. Maybe take off the “{1}” but it works with Perl expressions when I try it.
Try doing this: if you put the “?” into a character class to see if you can break out of the crash.