I am trying to find all the occurences of \"|\" in a string.
def findSectionOffsets(text):
startingPos = 0
endPos = len(text)
for position in te
if you want index of all occurance of | character in a string you can do this
In [30]: import re
In [31]: str = "aaaaaa|bbbbbb|ccccc|ffffdd"
In [32]: [x.start() for x in re.finditer('\|', str)]
Out[32]: [6, 13, 19]
also you can do
In [33]: [x for x, v in enumerate(str) if v == '|']
Out[33]: [6, 13, 19]