Does he win a snake?<br><br><div class="gmail_quote">On Sat, Feb 21, 2009 at 11:58 AM, Chris McAvoy <span dir="ltr"><<a href="mailto:chris.mcavoy@gmail.com">chris.mcavoy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Massimo is the winner!<br>
<br>
Thanks<br>
<div><div></div><div class="Wj3C7c"><br>
On Sat, Feb 21, 2009 at 10:55 AM, Massimo Di Pierro<br>
<<a href="mailto:mdipierro@cs.depaul.edu">mdipierro@cs.depaul.edu</a>> wrote:<br>
> This should do it<br>
><br>
> album_regex =<br>
> re.compile(r'^(?P<artist>.*)\s-\s(?P<album>.*?)\((?P<label>.*)\)$')<br>
><br>
><br>
> On Feb 21, 2009, at 10:23 AM, Chris McAvoy wrote:<br>
><br>
>> Hi All,<br>
>><br>
>> I have the following regex:<br>
>> album_regex =<br>
>> re.compile(r'(?P<artist>.*)\s-\s(?P<album>.*)\((?P<label>.*)\)')<br>
>><br>
>> Which matches things like: John Coltrane - Interstellar Space<br>
>> (Impulse ASD 9277)<br>
>> artist: John Coltrane<br>
>> album: Interstellar Space<br>
>> label: Impulse ASD 9277<br>
>><br>
>> very well, but has troubles on lines like:<br>
>><br>
>> John Coltrane - Coltrane In Japan (Impulse (J) IMR 9036C)<br>
>> artist: John Coltrane<br>
>> album: Coltrane In Japan (Impulse<br>
>> label: J) IMR 9036C<br>
>><br>
>> I get the feeling that there's a simple switch to say "get the first<br>
>> and last parens", but I'm having trouble with it, as I'm impatient,<br>
>> and not so hot at regex's.<br>
>><br>
>> Help me ChiPy, you're my only hope.<br>
>><br>
>> Chris<br>
>> _______________________________________________<br>
>> Chicago mailing list<br>
>> <a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
>> <a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
><br>
> _______________________________________________<br>
> Chicago mailing list<br>
> <a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
><br>
_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sincerely,<br>Brian Herman<br><br>