Reputation: 4540
I'm getting following warnings as a result my regex. Here's the line:
#define REGEX_FEILD_USERNAME @"[/\A[^0-9`!@#\$%\^&*+_=]+\z/]"
Warnings
unknown escape sequence \z
unknown escape sequence \A
unknown escape sequence \$
unknown escape sequence \^
How to solve this?
Upvotes: 0
Views: 1469
Reputation: 122391
As that string will be seen by the compiler you need to escape the \
characters as they have meaning within string literals:
#define REGEX_FEILD_USERNAME @"[/\\A[^0-9`!@#\\$%\\^&*+_=]+\\z/]"
Upvotes: 1