[thelist] Need a little Regex Help

Michael Buffington mike at stirlingbridge.com
Mon Sep 24 11:04:45 CDT 2001


I'm having difficulty forming a regular expression in ColdFusion for finding
strings that look like the following:

sql="SELECT col1, col2 FROM table WHERE col1 = 1;"
sql="SELECT col1, col2 FROM table WHERE col2 LIKE 'cow';"
sql="SELECT col1, col2 FROM table WHERE col2 IS NOT NULL" (notice lack of ;)

The string will always contain sql=" with a closing ". I've tried using
sql="(.*);"  as my pattern to match, but that's producing some strange
results (like finding everything from the start of the sql=" pattern to the
end of the document (even though it seems to me it should stop at the first
sign of the ; character.

Any help in forming a working regex pattern would be much appreciated.





More information about the thelist mailing list