两点水
This commit is contained in:
16
Code/Python14Code/com/twowater/test4.py
Normal file
16
Code/Python14Code/com/twowater/test4.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
import re
|
||||
|
||||
a = 'java*&39android##@@python'
|
||||
|
||||
# 数量词
|
||||
|
||||
findall = re.findall('[a-z]{4,7}', a)
|
||||
print(findall)
|
||||
|
||||
# 贪婪与非贪婪
|
||||
|
||||
re_findall = re.findall('[a-z]{4,7}?', a)
|
||||
print(re_findall)
|
||||
Reference in New Issue
Block a user