(\b) escape character for iOS regular expressions

There is a password regular expression in the project ^(?=.*\d)(?=.*[az])(?=.*[AZ]).{8,20}$

Xcode alarm warning ⚠️ Unknown escape sequence '\d', because \d is escaped by xcode, the regular expression will have problems;

Solution: Change \d to \\d: ^(?=.*\\d)(?=.*[az])(?=.*[AZ]).{8,20}$

Guess you like

Origin blog.csdn.net/wyz670083956/article/details/125097172