ok, so i kind of solved it. i found out that the reason it won't work
is that the non-greedy match won't match anything if nothing comes
after it.
my new regex (with some other things modified too) is this:
mircre = re.compile("""
(
(?:
\x03\\d{1,2}
(?:,\\d{1,2})?
)
|\x02|\x1F|\x16|^
)
([^\x03\x02\x1F\x16]*)
""", re.VERBOSE)
The only problem is that now, if we received a string with a \x03 in
it without a code, we won't capture it in either group. so i'm not
sure how else i could do it. maybe i could do a look-ahead with the
whole regex repeated, but that's kind of lame.
really i just want a way to find all occurrences of a regex that ends
with a non-greedy term and have the term consume anything up until the
next occurrence.
is that possible in python?