X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FGlobalData.py;h=e3131b86cc60fe4226cb8c99328b65d9bb2a858d;hb=92beb1e4c73a40a708c7c0cade5c7cee314b3887;hp=4a85a8e0db63ccf5d26055bc012d0d657abbd156;hpb=cd67d66484e44af587183d52f0affa9105547518;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index 4a85a8e0db..e3131b86cc 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -52,12 +52,21 @@ gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+") gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern)) # definition for a GUID. used to create regular expressions below. -_GuidPattern = r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" +_HexChar = r"[0-9a-fA-F]" +_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar) ## Regular expressions for GUID matching gGuidPattern = re.compile(r'{}'.format(_GuidPattern)) gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern)) +## Regular expressions for HEX matching +g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar)) +gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar)) +gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar)) + +## Regular expressions for string identifier checking +gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE) + # # A global variable for whether current build in AutoGen phase or not. #