Jump to content

Regex allows whitespace but shouldn't

Dan Munns

Recommended Posts

Hi all,

I have a field in an IC form that should limit the number of digits to 6 and return an error if anything else is entered:


However if the user adds a space to the end of the numbers then it is still allowed. I have tried this:


which should be the same but explicitly stating the numbers 0-9 and still have the same issue. 

Both above regex expressions match correctly in other applications and on testing sites by disallowing the data if a space is added to the end of the numbers. Am I missing something here or is this a bug? 

Link to comment
Share on other sites

@Victor PC2 was turned off, but if I turn it on there is no difference. 

If I use the new or old admin UI then this is the result whilst editing the PC


As you can see with many spaces it still passes the expression check. On the actual form on the portal it passes as well. 

Link to comment
Share on other sites

@Victor one issue I have now is with PC2 enabled one of my captures fails as below:

Only happens when dynamic questions are added to the form though (though this question itself is dynamic). Even if I turn off the requirement to have the question answered it still fails in the same way. With PC2 off this question works fine but then the regex question on a different form doesn't work as expected.

Link to comment
Share on other sites


@Ehsan so this question shows as not completed when it is completed when clicking 'Next' on the PC. This only happens when PC2 is enabled and when other dynamic questions are added to the form (seems to be these):

These questions have 3 override flags set:

Change Type in the CGL flag is a simple list with CGL appended to the change type in raw but not shown in display.

If PC2 is disabled then this question works as expected but the regex for a different form fails to work correctly (as per my original post in this thread).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...