def funMatch(args, **options):
try:
[2, 3].index(len(args))
except ValueError:
raise ParseError("match expects either two or three arguments")
flags = 0
if len(args) == 3:
if args[2] == 'i':
flags = re.IGNORECASE
else:
raise ParseError('match only supports the ignore case flag "i"')
if re.search(args[1],args[0],flags):
return "true"
else:
return "false"
评论列表
文章目录