Home Self-Service Portal - Community

Input validation with regular expressions

Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
In the old portal (SharePoint) when u specified a regex in the RO the input validation was done in the request form in the browser. How is this done today? i can input whatever characters i want in to the request form.

Best Answer

  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    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“”&]*$

Answers

  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    How do you filter unwanted strings and or characters ?
  • Tom_HydeTom_Hyde Customer Advanced IT Monkey ✭✭✭
    Hi @Robert_Osterberg

    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
  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    Hi We have that implemented also within SCSM but it is not validating on the form. I can submit whatever i Want in to the textfields in the ROs. So it seems that the portal is not recognising these regularexpressions. 
  • Adam_MorrisAdam_Morris Customer IT Monkey ✭
    I've also noticed this issue. I'm running portal version 7.4.2016.3 and it appears that the .NET Regular Expressions are not being enforced.
  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    We are on Current Portal Version: 7.4.2012.3, this is a new parrallel setup for running scsm 2012 before we migrate to 2016. Has anyone else the same problem. Or dont you use Runbooks for your workflows?? 
  • Robert_OsterbergRobert_Osterberg Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    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“”&]*$
  • Adrian_SaloneAdrian_Salone Partner IT Monkey ✭

    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?

  • Marek_LefekMarek_Lefek Customer Advanced IT Monkey ✭✭✭
    Could you help for expression to disable return sign. I try [a-z] but it wont works
Sign In or Register to comment.