1
rabbbit 2017-09-05 23:07:51 +08:00
print(re.search('(\d)\d\d', '123').group())
print(re.search('(\d)\d\d', '123').group(0)) print(re.search('(\d)\d\d', '123').group(1)) |
2
rabbbit 2017-09-05 23:09:41 +08:00 1
|
3
bbsteel 2017-09-05 23:13:56 +08:00 via Android 1
without arguments,group1 defaults to zero ( the whole match is retrun )。
就在官方文档里 |