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

Regex expression to find the substring that contains certain amount of certain characters with Python

$
0
0

I have a string like"GGACATCGCGGTGGATCGAC"

How can I find all substrings that contain, for example, three Gs in any order?For this string, it would be 'GCGG' or 'GTGG', or 'GGACATCG'.Also need to find such substrings for several letters, like, substrings with two Gs and one C ('GGAC', 'GGATC', 'CGG')


Viewing all articles
Browse latest Browse all 23390

Trending Articles



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