Geeks With Blogs
Joaquin Jares Just another geek's blog Language
Matching Braces with Regex
3 years ago, I wrote this post: http://regexlib.com/REDetai... It contained a .Net regular expression that would match the highest level of matching braces, something that is needed more often than not when parsing languages. It will also return null if no matching braces are found. Finally, as an added bonus, it will ignore braces that are escaped with a backslash. Soon after I posted it, someone commented on it being impossible, because Finite Automatas can’t count. I didn’t ......

Posted On Thursday, July 24, 2008 1:07 AM

Copyright © Joaquin Jares | Powered by: GeeksWithBlogs.net