Function matchQUASAR

  • 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

    • document: string
    • query: string

    Returns boolean

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

    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

    Gulakov, A. (2024)