I want to accept both quotes (',") in a password field validation, but my regex isn't functioning. I've tried a lot of regular expression patterns, but it doesn't work. Could you possibly help me?
I've used both regex:
RegExp 1: r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\$&*~\":;!?/()+\-\\\$[\]{}|/?>.<,::~^&*()_+=-]).{8,}$'
RegExp 2: r"[a-zA-Z0-9!@#$%^&*.,?/{}|()=+-:;'[]<>]"
Example string:
String password = """@Ado'da"foewa""";
These are the conditions I would like to have:
!.,@#$&*~":;'?/()+-[]{}<>_^
etc.)You can use multiline string: '''my string'''
Try: RegExp(r'''^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*['"!@#\$&*~:;!?/()+\-\\\$[\]{}|/?>.<,::~^&*()_+=-]).{8,}$''');
You forgot a number in this example:
String password = """@Ado'da"foewa""";