regex in natural language (javascript)

Discuss other useful utilities, general computing tips & tricks, Internet resources, etc.
Posts: 3134
Joined: 09 Oct 2013, 10:31

regex in natural language (javascript)

15 Jul 2020, 15:03

Super Expressive is a zero-dependency JavaScript library for building regular expressions in (almost) natural language

The following example recognises and captures the value of a 16-bit hexadecmal number like 0xC0D3

Code: Select all

const SuperExpressive = require('super-expressive');

const myRegex = SuperExpressive()
      .range('A', 'F')
      .range('a', 'f')
      .range('0', '9')

// Produces the following regular expression:

Posts: 1056
Joined: 15 Jun 2015, 06:21

Re: regex in natural language (javascript)

16 Jul 2020, 02:55

Very interesting. Good find!
Posts: 1353
Joined: 22 Jan 2017, 19:37

Re: regex in natural language (javascript)

16 Jul 2020, 09:13

Thank you for finding this and sharing it, @guest3456.

Return to “Other Utilities & Resources”

Who is online

Users browsing this forum: No registered users and 8 guests