- 1

Is it possible to use the regex modules search function to find the subsequence of a subtring in a string? Below is the example

22nd Jun 2021, 6:52 PM
Dan
Dan - avatar
2 Respuestas
0
String: Gegeeks Substring: ge Number of ge in string: 5 (Ge)geeks - 1 (G)eg(e)eks - 2 (G)ege(e)ks - 3 Ge(ge)eks - 4 Ge(g)e(e)ks - 5
22nd Jun 2021, 6:54 PM
Dan
Dan - avatar
0
As I know the re module can match only patterns with no splits : import re print(re.findall('ge','Gegeeks')) But I have give it a try in this code : https://code.sololearn.com/cz0BVFzkuU4e/?ref=app I don't know if this example will worm for you, but just see it . Copyright to GeeksForGeeks .
22nd Jun 2021, 9:23 PM
Ervis Meta
Ervis Meta - avatar