You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
477 B
16 lines
477 B
# 可视化正则表达式生成器
|
|
# https://www.wangwl.net/static/projects/visualRegex
|
|
import re
|
|
|
|
if __name__ == '__main__':
|
|
# 是否匹配指定的正则表达式
|
|
r = r'\w*(\w*元/年\w*)'
|
|
str = r'应用心理学(6000元/年;色盲、色弱者,不予录取.以上体检要求,录取时以高考体检表为准)'
|
|
m = re.search(r, str)
|
|
if m:
|
|
print(m)
|
|
print(m.group(0))
|
|
print(m.group(1))
|
|
else:
|
|
print("no")
|