trouble with regex?

Paul McGuire ptmcg at austin.rr.com
Thu Oct 8 17:13:06 EDT 2009


On Oct 8, 11:42 am, MRAB <pyt... at mrabarnett.plus.com> wrote:
> inhahe wrote:
> > Can someone tell me why this doesn't work?
>
> > colorre = re.compile ('('
> >                         '^'
> >                        '|'
> >                         '(?:'
> >                            '\x0b(?:10|11|12|13|14|15|0\\d|\\d)'
> >                            '(?:'
> >                               ',(?:10|11|12|13|14|15|0\\d|\\d)'
> >                            ')?'
> >                         ')'
> >                       ')(.*?)')
>
> > I'm trying to extract mirc color codes.
>

You might find this site interesting (http://utilitymill.com/utility/
Regex_For_Range) to generate RE's for numeric ranges.

-- Paul



More information about the Python-list mailing list