anymatch

Matches strings against configurable strings, globs, regular expressions, and/or functions

refa

A library for finite automata and regular expressions in the context of JS RegExp