Question

5
Replies
2471
Views
Nandhini21 Member since 2015 18 posts
Wipro
Posted: 3 years ago
Last activity: 3 years 1 month ago
Closed
Solved

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.

Low-Code App Development Case Management
Moderation Team has archived post
Share this page LinkedIn