regex-simplifier

1.0.0 • Public • Published

regex-simplifier 🪄

Generate regular expressions from natural language descriptions — and get an explanation too!

🚀 Install

npm install regex-simplifier

🔧 Usage (ESM)

import { createRegex } from 'regex-simplifier'

const result = createRegex("email address")

console.log(result)
/*
{
  regex: /^[^\s@]+@[^\s@]+\.[^\s@]+$/,
  explanation: "Matches a basic email format like 'user@example.com'"
}
*/

📚 Supported Descriptions

  • email address
  • 10-digit phone number
  • date in YYYY-MM-DD format
  • hex color
  • only letters

More coming soon!

🪄 License

MIT

Package Sidebar

Install

npm i regex-simplifier

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.83 kB

Total Files

3

Last publish

Collaborators

  • thealphadev