Jump to content
SJEaton

RegEx Validation for £

Recommended Posts

Hi

Is there a RegEx validation to limit a monetary amount e.g we don't want them a customer to enter more than £1500 in a field.  Is this possible?

Are there any regex examples /guidance published on wiki??

Sam

 

Share this post


Link to post
Share on other sites

Hi @SJEaton

Try this:

\b([1-9]|[1-8][0-9]|9[0-9]|[1-8][0-9]{2}|9[0-8][0-9]|99[0-9]|1[0-4][0-9]{2}|1500)\b

Screen Shot 2019-03-24 at 21.25.39.png

 

Screen Shot 2019-03-24 at 21.26.58.png

A useful utility to generate regex for numeric ranges can be found here: http://gamon.webfactional.com/regexnumericrangegenerator/

We don't have any formal documentation around useful regex on the Wiki but this is a good suggestion, so I'll ask internally if there is anything we can put together as a starting point. It would be also be very beneficial to see what other community users use as part of their configurations. For those reading this, please feel free to post here if anyone has regex that they regularly use that may be useful to others!

Kind Regards

Bob

  • Like 1

Share this post


Link to post
Share on other sites

Hi 

Is there a way to limit the amount of characters entered into a field?   I've had someone paste in a load of references into a single line text field.   We only expected one or maybe 2 reference numbers to be supplied

It lets the text go into the field, then stops the BPM as that field is used in the summary and it gives an error about the summary being too long.

image.png.625066d9e38185657a1007aa894f2c24.png

I'd like it to only allow a certain amount of characters and then give a warning.  In the meantime I can put something in the description to try and stop them while I think about how to change the PC

Any ideas or suggestions welcome!

thanks 

Helen

Share this post


Link to post
Share on other sites

@HGrigsby this should work: 

^.{0,30}$

Just change the second number to the max characters you want to allow.

It wont catch white space if it is at the beginning or end of the string though so you might need to make some adjustments for that if you are sailing close to the field character limit.

Share this post


Link to post
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...