I've making signup form screen
I made Regex patterns
Pattern pattern =
r'^(?=.*[a-zA-Z])(?=.*[*".!@#$%^&(){}:;<>,.?/~_+-=])(?=.*[0-9]).{8,30}$';
problem is if i add ', [ ] it doesn't work.
if I add ' error occurs in Android studio ( \ escape doesn't work )
if I add [, ], \, =, | these character, error doesn't occurs in AS but validation doesn't work in AVD and console says
The following FormatException was thrown while handling a gesture:
Unterminated character class^(?=.*[*.!@#$%^&(){}:;<>,?/~_+-=\]).{8,30}$
How can I fix this??
You should be able to solve this by concatenating your regex
Pattern pattern = r'^(?=.*[a-zA-Z])(?=.*[*".!@#\$%^&(){}:;<>,.\' + r"'?/~_+-=])(?=.*[0-9]).{8,30}\$";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.