运算符 描述字符串
xy? x xy
x|y x y
x* ' ' x xx xxx xxxx
xy? x xy
x|y x y
x* ' ' x xx xxx xxxx
x+ x xx xxx xxxx xxxxx、
例子
import re
def is_done(s):
return re.match('done|quit',s)!= None
def eat_low(s):
return ''.join([c for c in s if c.lower() not in 'aeiou'])#检查是不是元音
print eat_low('apple')