[Chicago] Basic Regex Question
Brian Herman
brianherman at gmail.com
Sat Feb 21 18:42:14 CET 2009
Does he win a snake?
On Sat, Feb 21, 2009 at 11:58 AM, Chris McAvoy <chris.mcavoy at gmail.com>wrote:
> Massimo is the winner!
>
> Thanks
>
> On Sat, Feb 21, 2009 at 10:55 AM, Massimo Di Pierro
> <mdipierro at cs.depaul.edu> wrote:
> > This should do it
> >
> > album_regex =
> > re.compile(r'^(?P<artist>.*)\s-\s(?P<album>.*?)\((?P<label>.*)\)$')
> >
> >
> > On Feb 21, 2009, at 10:23 AM, Chris McAvoy wrote:
> >
> >> Hi All,
> >>
> >> I have the following regex:
> >> album_regex =
> >> re.compile(r'(?P<artist>.*)\s-\s(?P<album>.*)\((?P<label>.*)\)')
> >>
> >> Which matches things like: John Coltrane - Interstellar Space
> >> (Impulse ASD 9277)
> >> artist: John Coltrane
> >> album: Interstellar Space
> >> label: Impulse ASD 9277
> >>
> >> very well, but has troubles on lines like:
> >>
> >> John Coltrane - Coltrane In Japan (Impulse (J) IMR 9036C)
> >> artist: John Coltrane
> >> album: Coltrane In Japan (Impulse
> >> label: J) IMR 9036C
> >>
> >> I get the feeling that there's a simple switch to say "get the first
> >> and last parens", but I'm having trouble with it, as I'm impatient,
> >> and not so hot at regex's.
> >>
> >> Help me ChiPy, you're my only hope.
> >>
> >> Chris
> >> _______________________________________________
> >> Chicago mailing list
> >> Chicago at python.org
> >> http://mail.python.org/mailman/listinfo/chicago
> >
> > _______________________________________________
> > Chicago mailing list
> > Chicago at python.org
> > http://mail.python.org/mailman/listinfo/chicago
> >
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>
--
Sincerely,
Brian Herman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20090221/30231736/attachment.htm>
More information about the Chicago
mailing list