On Tuesday February 7 2006 9:52 pm, Sara wrote:
> Using this query in my Perl Script to find the Category title from the
> database given as:
> C_and_C++/Forums
> C_and_C++/Codes
> C_and_C++/Sites
> etc.
> my $sql = qq(SELECT CAT_TITLE, FROM categories WHERE CAT_TITLE REGEXP
> '^C_and_C\\+\\+/[a-zA-Z|_]+\$' )
>
> $query = $dbh -> prepare ($sql) or die "Couldn't prepare statement: " .
> $dbh->errstr;
>
> $query->execute();
>
> And when the query is executed, I am gettin' error:
> "DBD::mysql::st execute failed: Got error 'repetition-operator operand
> invalid' from regexp"
> I am using double \\ in front of + as advised on the link given below but
> still gettin' error, any solution to it?
>
> http://213.136.52.42/bug.php?id=399

Hi Sara , I found when using MySql and perl together and attempting to phrase  
RegExp , I have had to double the  number of escape chars , thus \\ becomes 
\\\\ , then it works , thers a explanation for this behavior in the mysql 
refrence manual ...somthing about the mysql engin stripping out escape 
chars ... I Just know that it works for me when i double the escapes .

hope it helps you out ..

Greg Jetter 
Alaska Internet Solutions


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


Reply via email to