Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Can't get Text:...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 11040 of 11065
Post > Topic >>

Can't get Text::Balanced::extract_quotelike to work.

by nerdbiker@[EMAIL PROTECTED] (Tony Jones) May 7, 2008 at 02:41 AM

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




 1 Posts in Topic:
Can't get Text::Balanced::extract_quotelike to work.
nerdbiker@[EMAIL PROTECTE  2008-05-07 02:41:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 21:41:01 CDT 2008.