All Projects → mbasso → Natural Regex

mbasso / Natural Regex

Licence: mit
Create regex from natural language

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Natural Regex

Nlcst
Natural Language Concrete Syntax Tree format
Stars: ✭ 116 (-21.09%)
Mutual labels:  natural-language
Sammler
A tool to extract useful data from documents
Stars: ✭ 131 (-10.88%)
Mutual labels:  regex
Micromatch
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Stars: ✭ 1,979 (+1246.26%)
Mutual labels:  regex
Retext Equality
plugin to check for possible insensitive, inconsiderate language
Stars: ✭ 118 (-19.73%)
Mutual labels:  natural-language
Kaggle Quora Dup
Solution to Kaggle's Quora Duplicate Question Detection Competition
Stars: ✭ 129 (-12.24%)
Mutual labels:  regex
Recap
deserialize typed structures from regex captures
Stars: ✭ 135 (-8.16%)
Mutual labels:  regex
Learn Regex Zh
🇨🇳 翻译: 学习正则表达式的简单方法
Stars: ✭ 1,772 (+1105.44%)
Mutual labels:  regex
Tyre
Typed Regular Expressions
Stars: ✭ 145 (-1.36%)
Mutual labels:  regex
Bee.js
javaScript常用工具类
Stars: ✭ 130 (-11.56%)
Mutual labels:  regex
Nim Regex
Pure Nim regex engine. Guarantees linear time matching
Stars: ✭ 136 (-7.48%)
Mutual labels:  regex
Grepbugs
A regex based source code scanner.
Stars: ✭ 118 (-19.73%)
Mutual labels:  regex
Ffind
A sane replacement for find
Stars: ✭ 124 (-15.65%)
Mutual labels:  regex
Guide To Swift Strings Sample Code
Xcode Playground Sample Code for the Flight School Guide to Swift Strings
Stars: ✭ 136 (-7.48%)
Mutual labels:  regex
Pytextrank
Python implementation of TextRank for phrase extraction and summarization of text documents
Stars: ✭ 1,675 (+1039.46%)
Mutual labels:  natural-language
Bilibili Ban List
居家旅行常备的B站弹幕屏蔽列表
Stars: ✭ 143 (-2.72%)
Mutual labels:  regex
Lens Regex Pcre
Text lenses using PCRE regexes
Stars: ✭ 116 (-21.09%)
Mutual labels:  regex
Readable Pylint Messages
List of pylint human readable message ids and dev readable codes
Stars: ✭ 134 (-8.84%)
Mutual labels:  regex
Rosie Pattern Language
Rosie Pattern Language (RPL) and the Rosie Pattern Engine have MOVED!
Stars: ✭ 146 (-0.68%)
Mutual labels:  regex
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (-2.72%)
Mutual labels:  regex
Parse English
English (natural language) parser
Stars: ✭ 137 (-6.8%)
Mutual labels:  natural-language

natural-regex

Build Status npm version npm downloads Join the chat at https://gitter.im/mbasso/natural-regex

Create regex from natural language


Attention - This project isn't completed yet. There might be breaking changes until version 1.0.0. Feel free to contribute, see TODO to get started.


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.

Installation

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 <script> tag.

Usage

Once you have installed natural-regex, supposing a CommonJS environment, you can import and immediately use it:

import NaturalRegex from 'natural-regex';
// validate string
const dateAndEmail = NaturalRegex.from('starts with dd/MM/yyyy, space, minus, space and then email, end.');
dateAndEmail.test('06/07/2016 - [email protected]'); // this evaluates true
dateAndEmail.test('Foo Bar [email protected]'); // this evaluates false

// replace in string
NaturalRegex.replace({
  string: '06/07/2014 - [email protected]',
  match: 'yyyy',
  replace: '2016',
});
// this returns '06/07/2016 - [email protected]'

NaturalRegex also includes a command line tool, check this for more information.

Documentation

Visit the Wiki for the full documentation.

Examples

Examples can be found here

Change Log

This project adheres to Semantic Versioning.
Every release, along with the migration instructions, is documented on the Github Releases page.

Authors

Matteo Basso

Copyright and License

Copyright (c) 2016, Matteo Basso.

natural-regex source code is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].