]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools: AutoGen - use the new shared RegEx
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / UniClassObject.py
index 242402dfaeeb511f7bbf4420cbd7feafc8fe4d6f..8b0c563a8c8880a1b8e1905d43b5606888ee0a8f 100644 (file)
@@ -351,7 +351,7 @@ class UniFileClassObject(object):
         Name = Item.split()[1]\r
         # Check the string name\r
         if Name != '':\r
-            MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)\r
+            MatchString = gIdentifierPattern.match(Name)\r
             if MatchString is None or MatchString.end(0) != len(Name):\r
                 EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
         LanguageList = Item.split(u'#language ')\r
@@ -521,7 +521,7 @@ class UniFileClassObject(object):
                 Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File)\r
                 # Check the string name\r
                 if not self.IsCompatibleMode and Name != '':\r
-                    MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE)\r
+                    MatchString = gIdentifierPattern.match(Name)\r
                     if MatchString is None or MatchString.end(0) != len(Name):\r
                         EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File))\r
                 self.AddStringToList(Name, Language, Value)\r