You are here

function fuzzysearch_cleanse in Fuzzy Search 7

Same name and namespace in other branches
  1. 6 fuzzysearch.module \fuzzysearch_cleanse()

Strip all non alphanumeric characters from a string.

2 calls to fuzzysearch_cleanse()
FuzzysearchSearch::split in includes/processor_search.inc
Split token fields into ngrams.
fuzzysearch_parse_word in ./fuzzysearch.module
Insert the words into the database as they are indexed.

File

./fuzzysearch.module, line 163
Fuzzysearch module.

Code

function fuzzysearch_cleanse($text) {
  $text = strip_tags($text);
  $text = drupal_strtolower($text);
  return preg_replace('/[' . FUZZYSEARCH_PREG_CLASS_SEARCH_EXCLUDE . ']+/u', ' ', $text);
}