Input validation with regular expressions
Best Answer
-
Robert_Osterberg Customer Advanced IT Monkey ✭✭✭Update. After awsome support they found that the string that we used for regex in our SharePoint portal
^[^'"“”&]*$ did not reflect back to the Ciresson SSP. Instead the fix was to change the regex to
^[^\u0022\u0027“”&]*$
0
Answers
You can do this through the Request Offering > Configure Prompts on a string value you just need to configure the properties.
We have the following set-up on our users Job Title to not allow any special characters.
.NET Regular Expression: >
^[a-zA-Z0-9~!@#$%*()-=+;:,.? ]+$
Then enter a Custom ToolTip for the end user e.g. "No special characters such as '&' are allowed in this field."
Hope this helps.
Tom
^[^'"“”&]*$ did not reflect back to the Ciresson SSP. Instead the fix was to change the regex to
^[^\u0022\u0027“”&]*$
I have a related question - I'm trying to prevent the input of a newline character in a text prompt using the dotNet regex [A-Z0-9]+. (I'm pretty sure the preceeding regex is correct, but feel free to speak up if it's not).
Is the regex expression supposed to prevent the input of a newline, or only alert portal user if the text box contains a newline?