Hi,

I've been trying to use the extract_quotelike and extract_delimited
functions to extract a SQL statement from a line of C++ code but I
just can't get it to work.

The script is searching all .cpp files in a folder for SQL commands;
it manages to extract some but not all of them. I'm using a basic
regex to select only the lines which contain the word "SELECT" (which
is the start of all the SQL statements I'm interested in) and then
passing the line from the file to extract_quotelike (as all the SQL is
contained in double quotes).

If the input line only contains the SQL with no prefix, it works, but
when there are other characters before the quoted string it fails. For
example, passing the the C++ line:

Open(CRecordset::snapshot, "SELECT SCOPE_IDENTITY()
Build_request_Id");

to extract_quotelike returns an empty string as the extracted result
and the whole string as the remainder, indicating it found no quoted
strings in the line.

Can anyone tell me how to get the quoted string out of that line? I've
tried specifying all manner of parameters to the function and even
tried using extract_delimited but I can't get that to work either!

Thanks for any help,
Anthony


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to