I am writing a C++ style checker in Perl. But I am having a difficult time in constructing regular expressions for basic C++ constructs. For example if
loop can have following form:
if( expression ) {
or if ( expression ) ;
What I want is if the code does not following following guidelines then throw an error
if<space>(expression)<space>{
Now that expression
can be multi-line separated by logical operators, How Do I construct regular expression for the same?