Consider these Regexes written in Julia (they should be equivalent in Python):
φ = Regex("(?:[X](I*)){$n,}(?:5|6{$m,}|\\\$)")
ζ = Regex("(?:[X](I*)){$n,}(?:[5](I*){$m,}|6{$m,}|\\\$)")
They operate on a language $\Sigma = \{X, I, 5, 6\}$. They find patterns that consist of
- occurrences of $2, 3, 4, I$ (in any order) where total number of $2$s, $3$s and $4$s is at least $n$, as long as these occurrences end with a $m$ repetitions of character $5$ or $m$ repetitions of character $6$.
The difference between the first and second regex is that the first does not impose the condition that the sequence ends with more than $1$ repetitions of 5.
What are their equivalent regular expressions?