Basically i have a java String which i want to restrict all the characters other than this regex code
String UcharSet = "^[a-zA-Z0-9-~!@#().]+";
if("hello.hi".matches(UcharSet)){
UNotAllowedCharEC = "0x00000030";
}
now the problem is that my if statement always gets to execute although i have my regex to allow .
so i really appreciate if somebody tell me what am i doing wrong.
first i create a boolean which is equal to "hi+hello".matches(UcharSet)
and i needed to create an if statement and see if it returned true or false:
boolean UMORN = "hi+hello".matches(UcharSet);
if(UMORN != true)
UNotAllowedCharEC = "0x00000030";
User contributions licensed under CC BY-SA 3.0