Skip to content

Instantly share code, notes, and snippets.

@lxsndl
Created June 19, 2015 09:36
Show Gist options
  • Save lxsndl/6597373651a9d5fab0e0 to your computer and use it in GitHub Desktop.
Save lxsndl/6597373651a9d5fab0e0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
puts %r{ a+ # Some a characters
[0-9]+ # Some numbers
:[0-9] # A colon then a number
}x =~ "aaa23:7"
# This is functionally equivalent puts /a+[0-9]+:[0-9]/ =~ "aaa23:7"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment