in reply to Regular expression..

What you want is a lint for ruby

Text::Balanced, Regexp::Common, How do I find matching/nesting anything? Can I use Perl regular expressions to match balanced text? How do I use a regular expression to strip C style comments from a file?