I am trying to build an input mask but AIM is beating me.
The format of the string is:
3 Hex digits - 4 numeric digits - 8 Hex digits - 1 Hex.
Which gives a successful test on A02-2009-000004BE-A (as an example)
I have managed to test this outside of AIM and the expression
/([A-F0-9]{3})-\d{4}-([A-F0-9]{8})-([A-F0-9]{1})/
seems to capture the correct format.
However in the form that it is using it is not happy at all. Does anyone have any ideas?
More Regex Pain
Re: More Regex Pain
Where are you putting the regex?
If you are putting it in the "Input mask" property on the form, it will not work there.
It needs to be in the "Validate as" property on the attribute.
It worked for me there.
If you are putting it in the "Input mask" property on the form, it will not work there.
It needs to be in the "Validate as" property on the attribute.
It worked for me there.
Bob
-
- Posts: 1458
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: More Regex Pain
The regex is in the input mask - because the user should be guided whilst they are entering wherever possible, not be frustrated by an error afterwards.BobK wrote:Where are you putting the regex?
If you are putting it in the "Input mask" property on the form, it will not work there.
It needs to be in the "Validate as" property on the attribute.
It worked for me there.
I've tried using the above regex and specifying every character of the string but none work and worse create a field that is incapable of taking any data. Perhaps a limitation of the regex in AIM, in which case it should probably be added to the feature request list.
Re: More Regex Pain
The input mask does not accept regular expressions.
The following characters can be used in a mask and none of them represent HEX Digits.
The following characters can be used in a mask and none of them represent HEX Digits.
Bob
-
- Posts: 1458
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: More Regex Pain
Thanks Bob, reading is fundamental - I had been working under the wrong assumption.BobK wrote:The input mask does not accept regular expressions.
The following characters can be used in a mask and none of them represent HEX Digits.