Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Created September 14, 2018 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dasgoll/0e2addaa8bd35e7581be9700000f7c80 to your computer and use it in GitHub Desktop.
Save dasgoll/0e2addaa8bd35e7581be9700000f7c80 to your computer and use it in GitHub Desktop.
Ruby regex example
re = /[(]\d{2}[)]/m
str = '19
20
(24)
'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment