Posts Tagged ‘statement’

Regular Expression matching empty switch statements

Posted in General thoughts on February 7th, 2010 by Øyvind – Be the first to comment

In my continuing effort to track down a particularly nasty case of internal build error/classes must not be nested in Flash Builder. I ran a regex to find empty switch statements. These are notoriously known for causing this error, so in follow up to my post about regex for finding unterminated lines (another possible culprit), here is a RegExp that matches empty switch statements:

?View Code REGEXP
switch\s*?\(.*\).*\{\s*+\}