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">&lt;<a href="mailto:chris.mcavoy@gmail.com">chris.mcavoy@gmail.com</a>&gt;</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>
&lt;<a href="mailto:mdipierro@cs.depaul.edu">mdipierro@cs.depaul.edu</a>&gt; wrote:<br>
&gt; This should do it<br>
&gt;<br>
&gt; album_regex =<br>
&gt; re.compile(r&#39;^(?P&lt;artist&gt;.*)\s-\s(?P&lt;album&gt;.*?)\((?P&lt;label&gt;.*)\)$&#39;)<br>
&gt;<br>
&gt;<br>
&gt; On Feb 21, 2009, at 10:23 AM, Chris McAvoy wrote:<br>
&gt;<br>
&gt;&gt; Hi All,<br>
&gt;&gt;<br>
&gt;&gt; I have the following regex:<br>
&gt;&gt; album_regex =<br>
&gt;&gt; re.compile(r&#39;(?P&lt;artist&gt;.*)\s-\s(?P&lt;album&gt;.*)\((?P&lt;label&gt;.*)\)&#39;)<br>
&gt;&gt;<br>
&gt;&gt; Which matches things like: John Coltrane - Interstellar Space<br>
&gt;&gt; (Impulse ASD 9277)<br>
&gt;&gt; artist: John Coltrane<br>
&gt;&gt; album: Interstellar Space<br>
&gt;&gt; label: Impulse ASD 9277<br>
&gt;&gt;<br>
&gt;&gt; very well, but has troubles on lines like:<br>
&gt;&gt;<br>
&gt;&gt; John Coltrane - Coltrane In Japan &nbsp;(Impulse (J) IMR 9036C)<br>
&gt;&gt; artist: John Coltrane<br>
&gt;&gt; album: Coltrane In Japan &nbsp;(Impulse<br>
&gt;&gt; label: J) IMR 9036C<br>
&gt;&gt;<br>
&gt;&gt; I get the feeling that there&#39;s a simple switch to say &quot;get the first<br>
&gt;&gt; and last parens&quot;, but I&#39;m having trouble with it, as I&#39;m impatient,<br>
&gt;&gt; and not so hot at regex&#39;s.<br>
&gt;&gt;<br>
&gt;&gt; Help me ChiPy, you&#39;re my only hope.<br>
&gt;&gt;<br>
&gt;&gt; Chris<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Chicago mailing list<br>
&gt;&gt; <a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
&gt;&gt; <a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Chicago mailing list<br>
&gt; <a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
&gt; <a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
&gt;<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>