use re to check file is C++ or C mode