Skip to content

masui/expand_node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

re_expand

  • Generates all text strings that match the given regexp

  • "(a|b)(1|2)".expand() => ["a1", "a2", "b1", "b2"]

  • If a filter pattern is given, the output is filtered by the pattern.

Resources

Install

$ npm install re_expand

Usage

see sample/*.coffee.

require 're_expand'

console.log "(a|b|c)(x|y|z)(1|2|3)".expand()
Generator = require 're_expand'

generator = new Generator()
generator.add "(abc|def)(ghi|jkl)", 'Pattern "$1" and "$2".'
f = (a, cmd) -> console.log "#{a} => #{cmd}"
generator.filter " a ", f, 0

About

expand_ruby の Node版

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published