Re: Need help in Python regular expression

2009-06-12 Thread Rhodri James
On Fri, 12 Jun 2009 06:20:24 +0100, meryl wrote: On Jun 11, 9:41 pm, "Mark Tolonen" wrote: "meryl" wrote in message > Hi, > I have this regular expression > blockRE = re.compile(".*RenderBlock {\w+}") > it works if my source is "RenderBlock {CENTER}". [snip] ---cod

Re: Need help in Python regular expression

2009-06-12 Thread Jean-Michel Pichavant
To the OP, I suggest if you haven't yet Kodos, to get it here http://kodos.sourceforge.net/. It's a python regexp debugger, a lifetime saver. Jean-Michel John S wrote: On Jun 11, 10:30 pm, meryl wrote: Hi, I have this regular expression blockRE = re.compile(".*RenderBlock {\w+}") it w

Re: Need help in Python regular expression

2009-06-12 Thread Vlastimil Brom
2009/6/12 meryl : > On Jun 11, 9:41 pm, "Mark Tolonen" wrote: >> "meryl" wrote in message >> >> > I have this regular expression >... > I try adding ".*" at the end , but it ends up just matching the second > one. If there can be more matches in a line, maybe the non-greedy quantifier ".*?", a

Re: Need help in Python regular expression

2009-06-11 Thread meryl
On Jun 11, 9:41 pm, "Mark Tolonen" wrote: > "meryl" wrote in message > > news:2d4d8624-043b-4f5f-ae2d-bf73bca3d...@p6g2000pre.googlegroups.com... > > > > > > > Hi, > > > I have this regular expression > > blockRE = re.compile(".*RenderBlock {\w+}") > > > it works if my source is "RenderBlock {CEN

Re: Need help in Python regular expression

2009-06-11 Thread John S
On Jun 11, 10:30 pm, meryl wrote: > Hi, > > I have this regular expression > blockRE = re.compile(".*RenderBlock {\w+}") > > it works if my source is "RenderBlock {CENTER}". > > But I want it to work with > 1. RenderTable {TABLE} > > So i change the regexp to re.compile(".*Render[Block|Table] {\w+

Re: Need help in Python regular expression

2009-06-11 Thread Mark Tolonen
"meryl" wrote in message news:2d4d8624-043b-4f5f-ae2d-bf73bca3d...@p6g2000pre.googlegroups.com... Hi, I have this regular expression blockRE = re.compile(".*RenderBlock {\w+}") it works if my source is "RenderBlock {CENTER}". But I want it to work with 1. RenderTable {TABLE} So i change the

Need help in Python regular expression

2009-06-11 Thread meryl
Hi, I have this regular expression blockRE = re.compile(".*RenderBlock {\w+}") it works if my source is "RenderBlock {CENTER}". But I want it to work with 1. RenderTable {TABLE} So i change the regexp to re.compile(".*Render[Block|Table] {\w+}"), but that breaks everything 2. RenderBlock (CENT