i have a regular expression that's supposed to match any string containing certain words in no particular order.
the pattern is in PHP:
var $pattern = /^(?=.*\bword1\b)(?=.*\bword2\b)(?=.*\bword3\b).*$/gmi
this pattern works well both in javascript and php but in SQL, it does not work. I searched and found out that some of the patterns are not alike in SQL so i changed it and tried this pattern on the phpmyadmin to search for a specific title of a book containing some key words in the database like this:
SELECT * FROM userbooks WHERE book_title REGEXP '^(\\?=.*[[:<:]]word1[[:>:]])(\\?=.*[[:<:]]word2[[:>:]])(\\?=.*[[:<:]]word3[[:>:]]).*$'
but it doesnt return anything. i tried it back on php and javascript to match the title in a variable using the above code in PHP/JS and it worked fine but doesnt return anything in the database. i already tried using it via php to access the database but to no avail. i think it has something to do with the LOOK AHEAD ?= coz it works the same on PHP/JS/SQL without it. also tried doing two slashes, three and even four before the ?=
i also tried retrieving a book year which was 3333 using this code and it did not work either:
SELECT * FROM userbooks WHERE book_year REGEXP '33(\\?=33)'
is there any way to make this work or an alternative? or am i doing it wrong