+ 1

How it works?!

How do work functions match.group() and match.groups() in module "re"?

4th Jan 2021, 3:20 PM
QerdeX
3 Réponses
+ 4
Here if you mean that then if you write only group() it will return the whole pattern. If you write group(0) it will return the first group if the pattern in this code I have given bc is the first group of the pattern. If you write groups() then it will return the all group in a tuple. Hope this helpful.
4th Jan 2021, 3:44 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 5
I think there is no function called re.group() or re.groups() do you mean the attribute of match? This? https://code.sololearn.com/c8ESZ985Oyug/?ref=app
4th Jan 2021, 3:33 PM
The future is now thanks to science
The future is now thanks to science - avatar
+ 1
Yes, I mean the attribute of match. Sorry. But how it works?
4th Jan 2021, 3:41 PM
QerdeX