Skip to content

Instantly share code, notes, and snippets.

@TimLang
Last active January 2, 2016 16:39
Show Gist options
  • Save TimLang/8331190 to your computer and use it in GitHub Desktop.
Save TimLang/8331190 to your computer and use it in GitHub Desktop.
ruby recursion match
regex = /^(?<stack>{(\g<stack>|(?<num>\d))})$/
"{{2}}".match regex #<MatchData "{{2}}" stack:"{{2}}" num:"2">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment