Yevgen
Yevgen

Reputation: 797

Regex issue in SQL query

I cant seem to get the following search query to work in phpMyadmin.

 SELECT * FROM `my_table` WHERE `content` REGEXP 'https?\:\/\/(.*?(?<!cgi\.)ebay)';

Here is the error that I get:

 #1139 - Got error 'repetition-operator operand invalid' from regexp 

The regular expression itself works perfectly fine when I created it so not sure what is the problem, see here: http://regex101.com/r/qN2jX4/1

Upvotes: 0

Views: 53

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269443

The .*? looks suspect as does the ?<. Removing the extra ? fixes the error:

WHERE `content` REGEXP 'https?\:\/\/(.*(<!cgi\.)ebay)';

Perhaps this does what you want.

Upvotes: 2

Related Questions