Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Wipro
IN
Last activity: 8 Sep 2017 8:09 EDT
Allow backslash (\) during special characters validation
My requirement is to allow only -,/,\,( and ) and restrict all other special characters. I tried below expression and edit validate rule. Both of them are not allowing backslash (\). Please suggest proper syntex.
Expression:
@String.pxContainsSpecialCharacters(Param.DocNo,"-,/,\\,(,)")=="true"
Edit Validate:
java.util.regex.Pattern pattern=java.util.regex.Pattern.compile("[^A-Za-z &@'()-./0-9!#$%*_={}|:;<>\\~^]");
java.util.regex.Matcher match=pattern.matcher(new String(theValue));
boolean status= match.find();
if(status)
{return false;}
else
{return true;}
Thank you.