python代码使用正则化模块re检查字符串是否只含有要求指定的字符
compile():正则表达式被编译成模式对象,模式对象具有用于各种操作的方法,如搜索模式匹配或执行字符串替换。
search(): re.search()方法要么返回None(如果模式不匹配),要么返回包含字符串匹配部分信息的re.MatchObject。这个方法在第一次匹配之后停止,所以比起提取数据,它更适合测试正则表达式。
compile(): Regular expressions are compiled into pattern objects, which have methods for various operations such as searching for pattern matches or performing string substitutions.
search(): re.search() meth