[Tutor] Issues with regex escaping on \{

gpo goodpotatoes at yahoo.com
Wed Jul 29 21:47:57 CEST 2009


Thanks!  The ? got rid of the greediness! 


vince spicer wrote:
> 
> On Wed, Jul 29, 2009 at 11:35 AM, gpo <goodpotatoes at yahoo.com> wrote:
> 
> 
> your grouping (.+) appears to be greedy, you can make it non-greedy with a
> question mark
> 
> EX:
> 
> pUserID=re.compile('UserID:\s+{(.+?)}',re.I)
> 
> Vince
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 

-- 
View this message in context: http://www.nabble.com/Issues-with-regex-escaping-on-%5C%7B-tp24724060p24726284.html
Sent from the Python - tutor mailing list archive at Nabble.com.



More information about the Tutor mailing list