0

Someone Please Explain this code

import re pattern = r"1(23)(4(56)78)9(0)?" match = re.match(pattern, "1234567890?") if match: print("grupo :",(match.group())) print("grupo 0:",(match.group(0))) print("grupo 1:",(match.group(1))) print("grupo 2:",(match.group(2))) print("grupo 3:",(match.group(3))) print("grupo 4:",(match.group(4))) print(match.groups())

5th Apr 2020, 11:52 AM
Himanshu Jain
Himanshu Jain - avatar
3 Respostas
0
it will match and print the no along with str"Grupo :-no e.g.:-ans :-('grupo :', '1234567890') ('grupo 0:', '1234567890') ('grupo 1:', '23') ('grupo 2:', '45678') ('grupo 3:', '56') ('grupo 4:', '0') ('23', '45678', '56', '0')
6th Apr 2020, 8:40 AM
Aditya Deb Chowdhury
Aditya Deb Chowdhury - avatar
0
Thank You.
11th Apr 2020, 6:03 PM
Himanshu Jain
Himanshu Jain - avatar
11th Apr 2020, 6:20 PM
Himanshu Jain
Himanshu Jain - avatar