I have the following code
def append_letter(): string = 'ACAABAACAAABACDBADDDFSDDDFFSSSASDAFAAACBAAAFASD' result = [] # compete the pattern below pattern = r'(?<=AAA)\w+' for item in re.finditer(pattern, string): # identify the group number below. result.append(item.group(1)) return result
How to append the letter not included A letter
from script above I want to append any letter follow by triple A included A to a list.
How to achieve this by modifies only this line of code:
pattern = r'(?<=AAA)\w+'