matchete

1.0.1 • Public • Published

matchete Build Status

js-standard-style

Matchete is a super simple case-insensitive JavaScript string matcher that can be used to work out if a value fully or partially contains the words in a search string.

Installation

npm install --save matchete

API

Matchete accepts a source string, search string and an optional delimiter. The default delimiter is a single space.

matchete(sourceString, searchString, [delimiter])

Examples

matchete('foobar baz boz', 'foo') // true - partial match of the word
matchete('foobar baz boz', 'foobar') // true - full match of the word
matchete('foobar baz boz', 'foo ba') // true - partial match of multiple words
matchete('foobar baz boz', 'foO bA BO') // true - case-insensitive match
matchete('foobar baz boz', 'foo boz ba') // false - incorrect search word order
matchete('foobar_baz_boz', 'fo_ba__boz', '_') // true - using _ as delimiter instead of space

Testing

make bootstrap test

Readme

Keywords

none

Package Sidebar

Install

npm i matchete

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • qubit
  • oliverwoodings