Regular expression golf (finding a short regexp for a set) implemented in coffeescript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
browser
src
test
Gruntfile.js
LICENSE
README.md
package.json

README.md

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