]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: Check GUID C structure format
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
index fac7cde708f6d63e7ffec3c8d7d075489b486969..57048bcae64052e85d309b951879ff6a078eabf7 100644 (file)
@@ -66,6 +66,13 @@ gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))
 \r
 ## Regular expressions for string identifier checking\r
 gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r
+## Regular expression for GUID c structure format\r
+_GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \\r
+                      r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)\r
+gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))\r
 \r
 #\r
 # A global variable for whether current build in AutoGen phase or not.\r