I am trying to find amino acid sequences that start with either L or A and then end in either L or A with two amino acids in between each instance of L or A.
This is what I have:
re.findall("A|L.{2}A|L", string1)
output:
['A', 'L', 'A', 'L', 'A', 'A', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'LNLA', 'A', 'L', 'L', 'L', 'L', 'A', 'L', 'A', 'L', 'L', 'L', 'A', 'A', 'A', 'A', 'LACA', 'A', 'L', 'L', 'L', 'A', 'A', 'A', 'A', 'A', 'A', 'L', 'LPYA', 'A', 'A', 'A', 'A', 'L', 'L', 'A', 'A', 'A']
I assume the extra L's and A's have something to do with the syntax, but I'm not sure what this | is exactly doing.
[AL].{2}[AL].