私はmatches
に問題があります。私は、alphanumeric and special characters
の任意の組み合わせを含む可能性のある値を受け入れなければならないというフィールドを持っています。入力が1) combination of alphanumeric and special characters, and 2) alphanumeric
のときにうまく動作するコードがあります。しかし、入力に1) number and special characters ONLY without alphabet or 2) alphabet and special characters ONLY without number
の組み合わせが含まれていると、matches
にエラーが発生しました。私は何をしたかったことは最高の次の入力の組み合わせで動作matches
を作成することです:私はあなたの提案が必要英数字と特殊文字を含む入力の一致を書き込む方法
matches: /^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z_\[\]\\\^\$\.\|\?\*\+\(\)[email protected]#%&-=]{8,}$/
:
1) alphabet+number
2) alphabet+special character
3) alphabet+number+special character
4) number+special character
は、これは私のコードです! ありがとう!
ありがとうございました! – chemilleX3