On Feb 5, 6:18 pm, [EMAIL PROTECTED] wrote:
> Firstly, thanks to those who posted.
>
> I just do not understand how the non-greedy operator works.
>
> Using the following code:
>
> import re
>
> s = "qry_Lookup.desc = CSS_Rpt1.desc AND qry_Lookup.lcdu1 =
> CSS_Rpt1.lcdu"
>
> pat = "(.+=)+?(.+)"
Firstly, thanks to those who posted.
I just do not understand how the non-greedy operator works.
Using the following code:
import re
s = "qry_Lookup.desc = CSS_Rpt1.desc AND qry_Lookup.lcdu1 =
CSS_Rpt1.lcdu"
pat = "(.+=)+?(.+)"
m = re.match(pat, s)
if m is None:
print "No Match"
else:
On Feb 5, 8:31 am, [EMAIL PROTECTED] wrote:
> Hello again -
>
> I do not seem to be able to get a handle on non-greedy pattern
> matching.
>
Regexps wont cut it when you have to parse nested ()'s in a logical
expression.
Here is a pyparsing solution. For your specific application, you will
need
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Tuesday, February 05, 2008 9:31 AM
> To: python-list@python.org
> Subject: Using Regular Expressions to Parse SQL
>
>
> My pattern does not even come close.
>
> Any