Tiny library to make optimized regexes for a specific set of texts
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Cokefile
LICENSE.co
README.md
index.css
index.html
index.html.co
package.json
retrie.co
retrie.js
retrie.png
test.co

README.md

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?)?)?/