keywords-match
Demo
Usage
const matcher = require;const collection = ['cat', 'lion', 'sandcat', 'catfish'];const expression = 'cat -fish';const result = matcher;console.log; // ['cat', 'sandcat']
Supported operators
- ' ' (space) - Means both expressions are required
- '|' (pipeline) - Means at least one expression is required
- '-' (dash) - Means the following expression must not be met
- expression - The filtered string contains the expression
Operators in progress
- '""' (quotes) - Means the expression is matched exactly
Installation
npm i keywords-match