alexeld / regex-trie Goto Github PK
View Code? Open in Web Editor NEWCreate a regular expression to match any of the phrases added to the trie (inspired by Dan Kogai's Regexp::Trie Perl module.)
License: MIT License
Create a regular expression to match any of the phrases added to the trie (inspired by Dan Kogai's Regexp::Trie Perl module.)
License: MIT License
BTW, is there is a python version?
Hey @alexeld!
FYI, I’ve created a simple CLI for regex-trie. It can be found here: https://github.com/mathiasbynens/regex-trie-cli
The README has this TODO:
Regex options to configure capturing and anchoring
Instead, IMHO it would be better to add a toString
method to regex-trie. That way, the string output can be used as part of a regular expression literal (injected by a build script, for example) and any anchoring can be taken care of by the containing code.
It would also make it possible to do something similar at runtime, e.g.
var result = trie.toString();
var regex = RegExp('^(' + result + ')$', 'm');
FWIW, I have a project named Regenerate to create regular expressions based on a list of code points/symbols that provides toString
as its main functionality, and it’s been working well for me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.