

def TRegex(pobj):
    'Checks whether a string matches a specific regular expression.\n\n  @param pobj: Compiled regular expression as returned by C{re.compile}\n\n  '
    desc = WithDesc(('String matching regex "%s"' % pobj.pattern.encode('string_escape')))
    return desc(TAnd(TString, pobj.match))

dataset/ETHPy150Open ganeti/ganeti/lib/ht.py TRegex/original