data validation with regular expression - InfoPath Dev
in

InfoPath Dev

data validation with regular expression

Last post 11-19-2010 02:44 PM by yuipcheng. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 11-19-2010 02:44 PM

    data validation with regular expression

    ^(\.[0-9]{1})$|^([0-1][0-9]?(\.[0-9]{1})?)$|^(24(\.0)?)$|^(2[0-3](\.[0-9]{1})?)$

    i have this regular expression to validate user inputs in a textbox (any numbers from 0 to 24 with one decimal) but it doesn't seem to allow anything.

    i can break it down so it's easier to understand.

    ^(\.[0-9]{1})$                         <-- matches .0 to .9

    |                                          <-- or

    ^([0-1][0-9]?(\.[0-9]{1})?)$       <-- matches 0 - 19.9

    |

    ^(24(\.0)?)$                           <-- 24 or 24.0

    |

    ^(2[0-3](\.[0-9]{1})?)$            <-- 23 - 23.9

     

    i also tried to take out the ^ and $ but that allows any input...

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.