Use the RegExp
constructor to create a RegExp object from a string:
$('.autocomplete').autocomplete('getmatch.php', {
highlight: function(match, keywords) {
keywords = keywords.split(' ').join('|');
return match.replace(new RegExp("("+keywords+")", "gi"),'<b>$1</b>');
}
});
Gumbo
2009-06-05 17:56:19