3.在线正则调试工具
4.命名捕获组
python 正则写法示例如下:
import re
if __name__ =='__main__':
print('start>>>>')
regex_start_end =r'(?P<go>#TIME\d#)去,(?P<return>#TIME\d#)回来';
sentence ="#TIME0#去,#TIME1#回来";
temp = re.match(regex_start_end, sentence)
a = temp.group("go")
b = temp.group("return")
print (a)
print (b)