User input masks - Access Style

Tim Harig usernet at ilthio.net
Mon Dec 27 02:09:38 EST 2010


On 2010-12-27, Tim Harig <usernet at ilthio.net> wrote:
> ... if re.match(r'''^[0-9]{2}:[0-9]{2}:[0-9]{2}$''', timeInput) == None:
[SNIP]
> Currency works the same way using validating it against:
> r'''[0-9]+\.[0-9]{2}'''

Sorry, you need to check to make sure that there are no trailing characters
as in the example above.  Checking the beginning is not actually necessary
with match().

r'''^[0-9]+\.[0-9]{2}$'''



More information about the Python-list mailing list