diff --git a/src/OpenFOAM/primitives/Lists/stringListOps.H b/src/OpenFOAM/primitives/Lists/stringListOps.H
index 59c823b21d80342717c0c00517027fd771540177..f0a814329b6a8d56397eddd6a5bf5d2b1f30bc64 100644
--- a/src/OpenFOAM/primitives/Lists/stringListOps.H
+++ b/src/OpenFOAM/primitives/Lists/stringListOps.H
@@ -91,7 +91,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        return findStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        return findStrings(re, lst, invert);
     }
 
     //- Return list indices for strings matching the regular expression
@@ -104,7 +105,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        return findMatchingStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        return findMatchingStrings(re, lst, invert);
     }
 
     //- Return list indices for strings matching the regular expression
@@ -171,7 +173,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        return subsetMatchingStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        return subsetMatchingStrings(re, lst, invert);
     }
 
     //- Extract elements of StringList when regular expression matches
@@ -184,7 +187,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        return subsetMatchingStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        return subsetMatchingStrings(re, lst, invert);
     }
 
     //- Extract elements of StringList when regular expression matches
@@ -249,7 +253,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        inplaceSubsetMatchingStrings(re, lst, invert);
     }
 
     //- Inplace extract elements of StringList when regular expression matches
@@ -262,7 +267,8 @@ namespace Foam
         const bool invert=false
     )
     {
-        inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert);
+        const regExp re(rePattern);
+        inplaceSubsetMatchingStrings(re, lst, invert);
     }
 
     //- Inplace extract elements of StringList when regular expression matches