Sep-27-2017, 01:27 PM
Hello all, I'm trying to use the following method to find the "|" character in the following string as a little test:
Even more, strangely, it still returns a similar output when there is not even a "|" in the string:
[m.start() for m in re.finditer('|', 'fjd|fhjdkal|fgdha|ads')]Strangely it returns all of the character indexes, from 0 to 21. Why? It seems to work normally with other characters.
Even more, strangely, it still returns a similar output when there is not even a "|" in the string:
[m.start() for m in re.finditer("|", 'abc')]
Output:[0, 1, 2, 3]
Why? And how can I fix this problem? Thanks! I really need this for my new esolang!