diff --git a/install.php b/install.php
index 07571a59431b9784a7d65a9fc4c16dcc34e3d7dd..756bce8bc0290249f63a5de3da7d796a77fe264c 100644
--- a/install.php
+++ b/install.php
@@ -242,7 +242,7 @@ function getModule()
                 "\nWhat module name would you like to use? [blank for none] "
             )
         );
-        $regex = '/[a-zA-Z][0-9a-zA-Z_]*/';
+        $regex = '/^[a-zA-Z][0-9a-zA-Z_]*$/';
         $illegalModules = array('VuFind', 'VuFindConsole', 'VuFindTest');
         if (in_array($moduleInput, $illegalModules)) {
             echo "\n{$moduleInput} is a reserved name; please try another.\n";