This is string that I got
This given stirng
Immunodeficiency with increased immunoglobulin [M] [IgM]
Maternal care for anti-D [Rh] antibodies, unspecified trimester
I tried to finding multiple occurrences of a string within a string in Python, and get their index.
so, with a input string
char = random input string
I wanted result like this:
result = [[index, index, index],[index, index, index ]]
so, this is code that I used.
a = [m.start() for m in re.finditer(char,given string)]
,but it didn't work for metacharacters, and caused re.error: unterminated character set at position 0
how can I improve this code?