Skip to content

Instantly share code, notes, and snippets.

@chicks
Created November 9, 2012 20:12
Show Gist options
  • Save chicks/4047939 to your computer and use it in GitHub Desktop.
Save chicks/4047939 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
string = "6_7_0-nutmeg-build_fix"
regex = /([0-9])_([0-9])_([0-9])-([^-].*)-([^-].*)/
string =~ regex
puts [$1,$2,$3].join("_") + ("-",$4,".dev").join('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment