1.search和match:

search:在整个字符中匹配,如果找不到匹配的就返回None

match:在字符串开始位置匹配如果不匹配就返回None

2.效率对比:

search:

Python的re模块中search与match的区别Python的re模块中search与match的区别

 



  

match:

Python的re模块中search与match的区别Python的re模块中search与match的区别

 


  

 

相关文章: