Created
May 20, 2015 04:38
-
-
Save dandorman/34a646c23c4df9899fd3 to your computer and use it in GitHub Desktop.
A Ruby regular expression for matching pairs of braces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
braces = /\A([^(){}\[\]<>]*)(\((\g<1>\g<2>*\g<1>)\)|\{\g<3>\}|\[\g<3>\]|<\g<3>>)*\g<1>\z/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment