Iam trying to get all the indexes of specific group of special character ,but my regex is returning the index of single character of that group,
here is my code:-
a=re.finditer(r"[/ \\][\\ /]","/ \\ / \\ / \\ / /")
print([m.start(0) for m in a])
its returning [0,2,4,6,8,10,12]
but i want [0,2,4,6,8,10] , i only want index of "/ \" and "\ /"
re.finditer(r"(/) (\\)|(\\) (/)", "/ \\ / \\ / \\")and grab the appropriate groupstart()values.