I need a Regular expression validation which should have atleast any one special character except special characters (?
and _
).
Valid:
abcd%&
$ghksj
Invalid:
hhsh?
nxx_hus
I have tried this
^(?=[a-zA-Z0-9~@#$^*() =[\]{}|\\,.: -]*$)
CodePudding user response:
Use
^(?=[a-zA-Z0-9`!@#$%^&*() =\[\]{};':"\\|,.<>\/~-]*$).*
If lookaround not required:
^[a-zA-Z0-9`!@#$%^&*() =\[\]{};':"\\|,.<>\/~-]*$