Create regex from natural language
TODO to get started.Attention - This project isn't completed yet. There might be breaking changes until version 1.0.0. Feel free to contribute, see
natural-regex is a parser that allows you to write regular expressions in natural language. This means that you can write self documentating regex using a simpler syntax that can be undestood by anyone. No more pain with validations and other stuff.
You can install natural-regex using npm:
npm install --save natural-regex
If you aren't using npm in your project, you can include
NaturalRegex using UMD build in the dist folder with
Once you have installed natural-regex, supposing a CommonJS environment, you can import and immediately use it:
;// validate stringconst dateAndEmail = NaturalRegex;dateAndEmail; // this evaluates truedateAndEmail; // this evaluates false// replace in stringNaturalRegex;// this returns '06/07/2016 - email@example.com'
Visit the Wiki for the full documentation.
Examples can be found here
Copyright and License
Copyright (c) 2016, Matteo Basso.
natural-regex source code is licensed under the MIT License.