Skip to content

Instantly share code, notes, and snippets.

@BanzaiMan
Last active August 29, 2015 14:28
Show Gist options
  • Select an option

  • Save BanzaiMan/39599325320dc5543e8a to your computer and use it in GitHub Desktop.

Select an option

Save BanzaiMan/39599325320dc5543e8a to your computer and use it in GitHub Desktop.
$ pry
[1] pry(main)> /(\w+):?(\w*)/.match("one.two")
=> #<MatchData "one" 1:"one" 2:"">
[2] pry(main)> "one.two".scan /(\w+):?(\w*)/
=> [["one", ""], ["two", ""]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment