I am currently using on my php/Mysql db. The only problem is the expression is taking way to long to do the search of the db, even though the db is properly indexed. The expression finds an exact match in the Topic field which is what I wanted. However, the speed of search problem and the server load is a bigger problem. Here is the query with the regular expression.
Code: Select all
$query = "SELECT * FROM `View6` WHERE `Topic` REGEXP '[[:<:]]" .
mysql_real_escape_string($SeeAlso) .
"[[:>:]]' AND `Source` = $NNN OR (`Source` = $TTT) ORDER BY `Lnum` ASC";
Is there a way to change the regular expression above to find a white space before the
variable if the
variable is within a sentence or find the
variable if the
variable is the first word in the sentence. For example, if the user wants to find the word "fear" without the quotes, the regular expression would find...
fear
fearless
fearlessly
fearful
fearsome
...if these words appear at the beginning of a sentence or within a sentence.
Thank you in advance for any replies.