X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FAutoGen%2FUniClassObject.py;h=8b0c563a8c8880a1b8e1905d43b5606888ee0a8f;hp=242402dfaeeb511f7bbf4420cbd7feafc8fe4d6f;hb=1f26f5fdb96b4a0010c4388273fc42d551170dd6;hpb=7da06eeede10fc8b908327b375bcdf36707ff7b5 diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index 242402dfae..8b0c563a8c 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -351,7 +351,7 @@ class UniFileClassObject(object): Name = Item.split()[1] # Check the string name if Name != '': - MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE) + MatchString = gIdentifierPattern.match(Name) if MatchString is None or MatchString.end(0) != len(Name): EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File)) LanguageList = Item.split(u'#language ') @@ -521,7 +521,7 @@ class UniFileClassObject(object): Language = GetLanguageCode(Language, self.IsCompatibleMode, self.File) # Check the string name if not self.IsCompatibleMode and Name != '': - MatchString = re.match('^[a-zA-Z][a-zA-Z0-9_]*$', Name, re.UNICODE) + MatchString = gIdentifierPattern.match(Name) if MatchString is None or MatchString.end(0) != len(Name): EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File)) self.AddStringToList(Name, Language, Value)