here's the code I ended up using in qa-db-selects.php, line 491. You can probably spend a bit more time to optimize the regex for speed.
if (!empty($titlewords)) {
// At the indexing stage, duplicate words in title are ignored, so this doesn't count multiple appearances.
$selectspec['source'].=($selectparts++ ? " UNION ALL " : "").
"(SELECT postid AS questionid, LOG(#/titlecount) AS score, _utf8 'Q' AS matchposttype, postid AS matchpostid FROM ^titlewords JOIN ^words ON ^titlewords.wordid=^words.wordid WHERE word IN (";
//regex begin
$regex = "SELECT word FROM qa_words WHERE word REGEXP '\w{0,1}[.^^\s]*";
$rString = implode('|',$titlewords);
// '\w?[.^\s]*CFL[.^\s]*\w?'";
$selectspec['source'].=$regex.$rString."[.^^\s]*\w{0,1}') AND titlecount<#)";
//array_push($selectspec['arguments'], QA_IGNORED_WORDS_FREQ, $titlewords, QA_IGNORED_WORDS_FREQ);
array_push($selectspec['arguments'], QA_IGNORED_WORDS_FREQ, QA_IGNORED_WORDS_FREQ);
}
i also modified qa-db.php, line 183:
$query=strtr($query, array('^^'=>'^','^' => QA_MYSQL_TABLE_PREFIX));