Rather than flexing the regex to everything it *can do*, I'd do the following:
* Capture 2 parts of the number separated by a "-" or a whitespace: /^(\d+)[ \-]+(\d+)$/ * Use the captured parts to verify the lengths etc, using simple normal python. On Thu, Nov 25, 2010 at 4:11 PM, Kenneth Gonsalves <law...@au-kbc.org>wrote: > On Thu, 2010-11-25 at 16:06 +0530, Ramdas S wrote: > > > It is doable, but you should really use pyparsing for this - this is > > UGLY ! > > > :) > > > Meanwhile, let me hack on it. > > > > > > > Regex is ugly. I guess Kenneth being django guy wants to use the > > RegexField > > in django forms > > where do I send the coconut? > -- > regards > Kenneth Gonsalves > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers