Skip to content

Instantly share code, notes, and snippets.

@emiltin
Created April 17, 2010 16:09
Show Gist options
  • Save emiltin/369647 to your computer and use it in GitHub Desktop.
Save emiltin/369647 to your computer and use it in GitHub Desktop.
def ranges s
p s.scan(/[\d,]+/)
end
ranges "John 1,2"
ranges "John 1,2-4"
ranges "John 1,3-4"
ranges "John 1,2-7,17"
ranges "John 3-9,17"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment