> R. Alan Monroe wrote:
>> I'm searching through SQL logs and want to find lines that have
>> WHERE-less (unbounded) queries. I can't come up with a regex to say:
>> 
>> SELECT.*FROM.*(the word WHERE must not exist anywhere in the remainder
>> of the line)
>> 
>> Am I forgetting something simple or would this take two passes?

> Try using a negative look-ahead:
> SELECT.*FROM(?!.*WHERE)

Brilliant - works in python redemo, and grep too w/ -P switch.

Alan

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to