Re: repetition-operator operand invalid

2005-05-11 Thread Gleb Paharenko
Hello.



Use 5.0.4. Please, could you send an example of query (with pattern)

for words with sensitive characters which worked in 5.0.2 and doesn't

work in 5.0.4?





Scott Klarenbach <[EMAIL PROTECTED]> wrote:

> I've upgraded from 5.0.2 to 5.0.3 Beta, and now there is a glitch in

> one of my regular expression queries.

> 

> The expression works like this: a query for 'search' returns true for

> a matching 'search' field, but, querying 's$$#e%ar^c)(h' must also

> return true for a 'search' field.  In other words, I need to pad every

> letter of the search string and tell it to allow any number of

> non-alphanumeric characters.

> 

> Here is the expression I'm using below, for the term SEARCH:

> 

> '[^a-zA-Z0-9]*S[^a-zA-Z0-9]*E[^a-zA-Z0-9]*A[^a-zA-Z0-9]*R[^a-zA-Z0-9]*C[^a-=

> zA-Z0-9]*H[^a-zA-Z0-9]*'

> 

> As I said, it worked fine until I upgraded.  Is it to do with the

> double parsing MySQL does with REGEXP's?

> 

> In some instances, I get emtpy result set where I used to get a match,

> and in other instances, I get a 'repetition-operator operand invalid'.

> Is there a simple way I can prevent errors from a search string that

> contains ^*$ or other sensitive expression characters?  addslashes()

> in php maybe?

> 

> Any help is appreciated.

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
   <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



repetition-operator operand invalid

2005-05-10 Thread Scott Klarenbach
I've upgraded from 5.0.2 to 5.0.3 Beta, and now there is a glitch in
one of my regular expression queries.

The expression works like this: a query for 'search' returns true for
a matching 'search' field, but, querying 's$$#e%ar^c)(h' must also
return true for a 'search' field.  In other words, I need to pad every
letter of the search string and tell it to allow any number of
non-alphanumeric characters.

Here is the expression I'm using below, for the term SEARCH:

'[^a-zA-Z0-9]*S[^a-zA-Z0-9]*E[^a-zA-Z0-9]*A[^a-zA-Z0-9]*R[^a-zA-Z0-9]*C[^a-zA-Z0-9]*H[^a-zA-Z0-9]*'

As I said, it worked fine until I upgraded.  Is it to do with the
double parsing MySQL does with REGEXP's?

In some instances, I get emtpy result set where I used to get a match,
and in other instances, I get a 'repetition-operator operand invalid'.
 Is there a simple way I can prevent errors from a search string that
contains ^*$ or other sensitive expression characters?  addslashes()
in php maybe?

Any help is appreciated.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



"repetition-operator operand invalid" error?

2001-07-04 Thread Chris Petersen

I recently started getting this error from a query:

>   Got error 'repetition-operator operand invalid' from
>   regexp (SELECT id, IF(parents LIKE '_%',CONCAT(parents,'
>   name),name) AS name, usergrp FROM Categories WHERE id > 10 AND id
>   AND parents NOT RLIKE '^\* New Category \*(|$)' ORDER BY name)

(that extra space before |$ was a tab character)

Anyway, I assume the error is happening because of the * character in the
RLIKE statement..  Though you'd assume that since it's escaped it should be
fine.  Or is this not the case?  Help?


Thanks...

-Chris


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php