Skip to main content

match-quasar

Documentation / match/match-quasar

Match​

matchQUASAR()​

function matchQUASAR(document: string, query: string): boolean;

Defined in: match/match-quasar.js:19

QUASAR: Quotes-Unifying Alphanumeric Search-All RegExp​

Search document for all words of query ignoring casing but "words in quotes" as necessarily together like users expect in web search engines. Single line function that can be used anywhere, such as UI inputs to filter a data list.

Parameters​

ParameterTypeDescription

document

string

query

string

Returns​

boolean

true if doc has all words and "phrases in quotes"

Example​

var isFound = matchQUASAR(`Ask not what your country can do for you, 
ask what you can do for your country. is nothing to fear but fear itself.`,
` "Ask not" "but fear itself" nothing`) // returns true

Author​

ai-research-agent (2024)