两点水

This commit is contained in:
347073565@qq.com
2017-12-26 11:14:36 +08:00
parent c7c4d7a559
commit 1a74b345e5
15 changed files with 799 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import re
a = 'uav,ubv,ucv,uwv,uzv,ucv,uov'
# 字符集
# 取 u 和 v 中间是 a 或 b 或 c 的字符
findall = re.findall('u[abc]v', a)
print(findall)
# 如果是连续的字母,数字可以使用 - 来代替
l = re.findall('u[a-c]v', a)
print(l)
# 取 u 和 v 中间不是 a 或 b 或 c 的字符
re_findall = re.findall('u[^abc]v', a)
print(re_findall)