diff --git a/old/vtkCompilerExtras.cmake b/CMake/vtkCompilerExtras.cmake
index 05b2db9..92c2c4c 100644
--- a/old/vtkCompilerExtras.cmake
+++ b/CMake/vtkCompilerExtras.cmake
@@ -27,7 +27,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     OUTPUT_VARIABLE _gcc_version_info
     ERROR_VARIABLE _gcc_version_info)
 
-  string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
+  string (REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]"
     _gcc_version "${_gcc_version_info}")
   if(NOT _gcc_version)
     string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
diff --git a/old/GenerateExportHeader.cmake b/CMake/GenerateExportHeader.cmake
index 3cc12dd..b7a47df 100644
--- a/old/GenerateExportHeader.cmake
+++ b/CMake/GenerateExportHeader.cmake
@@ -166,7 +166,7 @@ macro(_test_compiler_hidden_visibility)
     execute_process(COMMAND ${CMAKE_C_COMPILER} --version
       OUTPUT_VARIABLE _gcc_version_info
       ERROR_VARIABLE _gcc_version_info)
-    string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
+    string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]"
       _gcc_version "${_gcc_version_info}")
     # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
     # patch level, handle this here:
