def __init__(self, text = _g('Only numbers, dots, and hyphens are allowed')+'.'): Regexp.__init__(self, '^[\d\.\-]*$', message = text)
def __init__(self, text = _g('Only digits are allowed')+'.'): Regexp.__init__(self, '^[\d]*$', message = text)
def __init__(self, text = _g('Only letters, numbers, and following characters are allowed')+': - ! " # % & \' ( ) * + / \\ . ? @'): Regexp.__init__(self, '^[\w\-\!\"\#\%\&\'\(\)\*\+\/\\\.\?\@]*$', message = text)
def __init__(self, text = _g('Only upper case letters are allowed')+'.'): Regexp.__init__(self, '^[A-Z]*$', message = text)
def __init__(self, text = _g('Only letters, numbers, spaces, dots, commas, and hyphens are allowed')+'.'): Regexp.__init__(self, '^[\w\-\.\, ]*$', message = text)
def __init__(self, text = _g('Value does not match expected phone number format')+'. '+\ _g('E.g. 069/1128767, 0691128767, +387691128767, 059/343565, 059343565, +38759343565')+'.'): Regexp.__init__(self, '^((0\d{2}\/)|(0\d{2})|(\+\d{1,3}\d{2}))\d{6,8}$', message = text)
def __init__(self, require_tld=True, message=None): tld_part = require_tld and r"\.\w{2,10}" or "" regex = r"^[a-z]+://([^/:]+%s|([0-9]{1,3}\.){3}[0-9]{1,3})(:[0-9]+)?(\/.*)?$" % tld_part Regexp.__init__(self, regex, re.IGNORECASE | re.UNICODE, message)