[Tutor] using re

johnf jfabiani at yolo.com
Mon Jun 4 07:16:50 CEST 2007


I have the following
pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth, 
self.DecimalWidth)
)
	if re.match(pattern, self.GetValue())==None:
	    self.BackColor == "pink"
	else:
	    self.BackColor == "white"

self.IntegerWidth = 2
self.DecimalWidth=2

the problem is the pattern allows ".999".  What am I doing wrong?
-- 
John Fabiani


More information about the Tutor mailing list