Return to Snippet

Revision: 50125
at August 11, 2011 10:11 by ronakpatel2006


Initial Code
import re
def check_mdn(mdn, mdn_re = re.compile('^\d{10,15}$')):
    ''' Check if MDN is acceptable
    '''

    print " MDN: %s " % mdn
    if mdn_re.match(str(mdn)):
        print " %s is fine " % mdn
        return True
    else:
        print " %s is not fine" % mdn
        return False


mdn = '1234'
mdn1 = '1212121212'
mdn12= '121212121212'
mdn15= '121212121212121'
mdn18= '123456789012345678'

check_mdn(mdn)
check_mdn(mdn1)
check_mdn(mdn12)
check_mdn(mdn15)
check_mdn(mdn18)

Initial URL

                                

Initial Description

                                

Initial Title
CHeck the length of the mdn

Initial Tags

                                

Initial Language
Python