Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14215

How to use Rex to find letter which following by

$
0
0

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+'

Viewing all articles
Browse latest Browse all 14215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>