Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regular Expression In Oracle ADF

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.

like image 921
Navneet Mishra Avatar asked Feb 22 '26 16:02

Navneet Mishra


1 Answers

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@#$%^&*()_+=~-]+$';
                                   ^^  
like image 117
Wiktor Stribiżew Avatar answered Feb 24 '26 06:02

Wiktor Stribiżew