I am using Regular Expression to allow all the Special Characters along with Numbers and alphabets in java based ORACLE ADF. Following is my Regular Expression:
regExVal="^[a-zA-Z0-9@#$%^&*()-+=~!_]+$";
But I am getting error,If i am adding ! or _ characters. The rest works.
Your current regex does not match a string containing - because [)-+] matches ), * and +. The double quoted string literal seems to be the culprit, too.
You need to define the pattern inside single quotes and put the hyphen at the end of the character class:
regExVal='^[!a-zA-Z0-9@#$%^&*()_+=~-]+$';
^^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With