function search_query_extract in Drupal 4
Same name and namespace in other branches
- 5 modules/search/search.module \search_query_extract()
- 6 modules/search/search.module \search_query_extract()
Extract a module-specific search option from a search query. e.g. 'type:book'
2 calls to search_query_extract()
- node_search in modules/
node.module - Implementation of hook_search().
- search_query_insert in modules/
search.module - Return a query with the given module-specific search option inserted in. e.g. 'type:book'.
File
- modules/
search.module, line 613 - Enables site-wide keyword searching.
Code
function search_query_extract($keys, $option) {
if (preg_match('/(^| )' . $option . ':([^ ]*)( |$)/i', $keys, $matches)) {
return $matches[2];
}
}