More Regex Pain

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

More Regex Pain

Post by PointsWell »

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?
BobK
Posts: 545
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: More Regex Pain

Post by BobK »

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.
Bob
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: More Regex Pain

Post by PointsWell »

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.
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.

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.
BobK
Posts: 545
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: More Regex Pain

Post by BobK »

The input mask does not accept regular expressions.

The following characters can be used in a mask and none of them represent HEX Digits.
mask.jpg
mask.jpg (34.59 KiB) Viewed 6475 times
Bob
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: More Regex Pain

Post by PointsWell »

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.
mask.jpg
Thanks Bob, reading is fundamental - I had been working under the wrong assumption.
Post Reply