What's the difference between groups and group in the re module?

前端 未结 3 745
情歌与酒
情歌与酒 2021-02-06 01:11

Here it is:

import re
>>>s = \'abc -j k -l m\'
>>>m = re.search(\'-\\w+ \\w+\', s)
>>>m.groups()
()
>>> m.group(0)
\'-j k\'
<         


        
3条回答
提交回复
热议问题