Skip to content

Regular expression golf (finding a short regexp for a set) implemented in coffeescript

License

Notifications You must be signed in to change notification settings

amitayd/regexp-golf-coffeescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regexp-golf-coffeescript

Regular expression golf (finding a short regexp for a set) implemented in coffeescript

See blog post @ http://www.doboism.com/blog/2014/01/19/coffeescript-regex-golf

###How to run###

Main Coffee under Node:

coffee src/main.js

In code or in the console:

regexpGolf = require('./src/regexpGolf.coffee')
Set = require('./src/set.coffee')

winners =  new Set(['fireman', 'trucker', 'samurai', 'chef'])
losers = new Set(['lawyer', 'senator', 'waiter', 'chief'])

settings = {
  randomFactor: 1
  branches: 2
  depthBranches: {}
}

console.log regexpGolf.find(winners, losers, settings)

For the browser: open browser/index.html

Test and build

Install grunt-cli and the package

sudo npm install -g grunt-cli
npm install .

grunt

About

Regular expression golf (finding a short regexp for a set) implemented in coffeescript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages