diff --git a/verify_commit_messages/amoslib.php b/verify_commit_messages/amoslib.php
index 74791780..75e5971b 100644
--- a/verify_commit_messages/amoslib.php
+++ b/verify_commit_messages/amoslib.php
@@ -325,7 +325,7 @@ protected static function legacy_component_name($newstyle) {
         $newstyle = trim($newstyle);
 
         // See {@link PARAM_COMPONENT}.
-        if (!preg_match('/^[a-z]+(_[a-z][a-z0-9_]*)?[a-z0-9]+$/', $newstyle)) {
+        if (!preg_match('/^[a-z][a-z0-9]*(_[a-z][a-z0-9_]*)?[a-z0-9]+$/', $newstyle)) {
             return false;
         }