Skip to content

satyr/retrie

Repository files navigation

Retrie

JS port of @dankogai's RegexpTrie, written in Coco.

usage

RegExp('^' + Retrie(['a', 'ab', 'ac', 'd']))  //=> /^(?:a[bc]?|d)/
RegExp('^' + Retrie(['abcd'], true))          //=> /^a(?:b(?:cd?)?)?/

About

Tiny library to make optimized regexes for a specific set of texts

Resources

License

Stars

Watchers

Forks

Packages

No packages published