regexinfopath2010

Infopath regex validation error when value is correct


i seem to be having a very strange validation issue with an input field in the Microsoft InfoPath 2010 form i'm debugging.

The form has this custom pattern rule to validate the field: ^([0-9]?[0-9]?[0-9]?)(.(0|25|5|75)0*)?$

Essentially it should accept 0.00,1.50,500.75, etc but i keep getting a validation error.

In order for the input to be valid, it must respect the regex and not be empty, both of which are true, yet the error persists. Does anyone know why?


Update

By removing the start and end char, the regex works!


Solution

  • I found it!

    My regex would always return false because of the start and end char: ^([0-9]?[0-9]?[0-9]?)(.(0|25|5|75)0*)?$.

    By removing these the validation worked