def SpecialString(v):
    import re
try:
    return re.match('^1:m:([1-9]|10):p:(1|2|3|4)$', v).group(0)
except:
    raise argparse.ArgumentTypeError(
        "String '%s' does not match required format" % (v,))
argparse choices structure of allowed values