I am trying to write a regex expresstion in mysql from a Perl program. I want to have query such as this:
WHERE a.keywords REGEXP '[[:<:]]something[[:>:]]'
However, in Perl when I make this query I am getting error when concatenating:
for($i=0;$i<$count;$i++){
$where = $where . "'[[:<:]]$andkeywords[$i][[:>:]]' "; #errors
Where as this does not give me an error:
for($i=0;$i<$count;$i++){
$where = $where . "'[[:<:]] $andkeywords[$i] [[:>:]]' "; #no error
In the 'no error' code notice that there are extra spaces. But if I have extra spaces then I do not get the resuls I want because in the DB there are no 'extra spaces'.