{"id":13426611,"url":"https://github.com/mbasso/natural-regex","last_synced_at":"2025-03-15T09:31:44.713Z","repository":{"id":44361307,"uuid":"71170519","full_name":"mbasso/natural-regex","owner":"mbasso","description":"Create regex from natural language","archived":false,"fork":false,"pushed_at":"2017-02-26T21:00:21.000Z","size":74,"stargazers_count":153,"open_issues_count":2,"forks_count":10,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-04T06:49:10.580Z","etag":null,"topics":["javascript","natural-language","regex"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbasso.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-17T18:51:25.000Z","updated_at":"2025-02-23T08:46:12.000Z","dependencies_parsed_at":"2022-08-29T08:02:09.764Z","dependency_job_id":null,"html_url":"https://github.com/mbasso/natural-regex","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fnatural-regex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fnatural-regex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fnatural-regex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbasso%2Fnatural-regex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbasso","download_url":"https://codeload.github.com/mbasso/natural-regex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713357,"owners_count":20335564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","natural-language","regex"],"created_at":"2024-07-31T00:01:39.077Z","updated_at":"2025-03-15T09:31:44.408Z","avatar_url":"https://github.com/mbasso.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# natural-regex\n\n[![Build Status](https://travis-ci.org/mbasso/natural-regex.svg?branch=master)](https://travis-ci.org/mbasso/natural-regex)\n[![npm version](https://img.shields.io/npm/v/natural-regex.svg)](https://www.npmjs.com/package/natural-regex)\n[![npm downloads](https://img.shields.io/npm/dm/natural-regex.svg?maxAge=2592000)](https://www.npmjs.com/package/natural-regex)\n[![Join the chat at https://gitter.im/mbasso/natural-regex](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mbasso/natural-regex?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\u003e Create regex from natural language\n\n---\n\n**Attention - This project isn't completed yet. There might be breaking changes until version 1.0.0. Feel free to contribute, see [TODO](https://github.com/mbasso/natural-regex/blob/master/TODO.md) to get started.**\n---\n\n---\n\n[natural-regex](https://github.com/mbasso/natural-regex) is a parser that allows you to write regular expressions in natural language.\nThis means that you can write self documentating regex using a simpler syntax that can be undestood by anyone.\nNo more pain with validations and other stuff.\n\n## Installation\n\nYou can install natural-regex using [npm](https://www.npmjs.com/package/natural-regex):\n\n```bash\nnpm install --save natural-regex\n```\n\nIf you aren't using npm in your project, you can include `NaturalRegex` using UMD build in the dist folder with `\u003cscript\u003e` tag.\n\n## Usage\n\nOnce you have installed natural-regex, supposing a CommonJS environment, you can import and immediately use it:\n\n```js\nimport NaturalRegex from 'natural-regex';\n// validate string\nconst dateAndEmail = NaturalRegex.from('starts with dd/MM/yyyy, space, minus, space and then email, end.');\ndateAndEmail.test('06/07/2016 - foo@bar.com'); // this evaluates true\ndateAndEmail.test('Foo Bar foo@bar'); // this evaluates false\n\n// replace in string\nNaturalRegex.replace({\n  string: '06/07/2014 - foo@bar.com',\n  match: 'yyyy',\n  replace: '2016',\n});\n// this returns '06/07/2016 - foo@bar.com'\n```\n\nNaturalRegex also includes a [command line tool](https://github.com/mbasso/natural-regex-cli), check [this](https://github.com/mbasso/natural-regex/wiki/Cli) for more information.\n\n## Documentation\n\nVisit the [Wiki](https://github.com/mbasso/natural-regex/wiki) for the full documentation.\n\n## Examples\n\nExamples can be found [here](https://github.com/mbasso/natural-regex/wiki/Examples)\n\n## Change Log\n\nThis project adheres to [Semantic Versioning](http://semver.org/).  \nEvery release, along with the migration instructions, is documented on the Github [Releases](https://github.com/mbasso/natural-regex/releases) page.\n\n## Authors\n**Matteo Basso**\n- [github/mbasso](https://github.com/mbasso)\n- [@teo_basso](https://twitter.com/teo_basso)\n\n## Copyright and License\nCopyright (c) 2016, Matteo Basso.\n\nnatural-regex source code is licensed under the [MIT License](https://github.com/mbasso/natural-regex/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Fnatural-regex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbasso%2Fnatural-regex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbasso%2Fnatural-regex/lists"}