rexer

0.1.0 • Public • Published

rexer

Generate matching strings from regular expressions.

$ npm install rexer [-g]

Usage

rex <pattern[, pattern[, ...]]>
var rex = require('rexer');
var matches = rex(pattern[, pattern[, ...]]);

Arguments are automatically concatenated, so rex a b is equivalent to rex ab. The same applies when used as a module.

Works for

  • literals,
$ rex "abcd"
["abcd"]
  • character sets
$ rex "[a-c][0-2]"
["a0","a1","a2","b0","b1","b2","c0","c1","c2"]
  • and alternations.
$ rex "(hi|bye) world"
["hi world","bye world"]

Not yet implemented

  • quantifiers,
  • special characters,
  • backreferences (?)
  • and lookaheads (?).

Readme

Keywords

Package Sidebar

Install

npm i rexer

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • mateogianolio