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 no
Hello again -
I do not seem to be able to get a handle on non-greedy pattern
matching.
I am trying to parse the following - note that there are no line
breaks in the string:
" FROM ((qry_Scores_Lookup1 INNER JOIN CSS_Rpt1 ON
(qry_Scores_Lookup1.desc = CSS_Rpt1.desc) AND
(qry_Scores_Lookup1.lastc