You are viewing limited content. For full access, please sign in.

Question

Question

regular expressions syntax error 9337

asked on April 30, 2015

OK, I've created a template in Avante 9.2. It has this field called 'ThisCompany Account Code'. It's a number field, it's required and these codes are always in the form ##-###-###-###. So I'm trying to create a constraint that looks like this:

\d\d-\d\d\d-\d\d\d-\d\d\d

This is almost identical to the syntax used in the design guide examples, so should work, but instead generates this 9337 syntax error. The online help helpfully says 'This is a syntax error'. Awesome.

As a larger problem, it appears that the regular expressions don't work at all in any of the fields I create. Every regex throws this 9337 syntax error, even the most basic, like '\d' or '[0-9]'. Relational operators seem fine, like '=<1' for example, works as expected.

Not sure what to do next. Is there maybe a global setting to enable regular expressions somewhere that I need to turn on?

Dale.

0 0

Answer

SELECTED ANSWER
replied on April 30, 2015

Your constraint is not a number, so it won't be accepted in a number field. You want a text field.

1 0

Replies

replied on April 30, 2015

Right, creating a new field as a text field seems to accept that regex. Thanks Miruna. Couldn't actually edit the existing field I created earlier, just had to delete it. 

All the user submitted values need to be numbers, so is it the dashes that make this field not a number? Or asked another way, is the number data type (and integers and long integers I guess) intended to be used only in anticipation that some mathematical operation might be performed on it later?

DG.

0 0
replied on May 1, 2015

The number field only accepts 0-9 and a period as the decimal separator (or a comma depending on your locale). You can format it, but it still has to be a number formatting. Your interpretation of it as something you'd be able to do math on is correct.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.