From 85e5d3cf6b32127977d0d4ef293f4b07daa23747 Mon Sep 17 00:00:00 2001 From: "Feng, YunhuaX" Date: Wed, 8 Aug 2018 14:14:20 +0800 Subject: BaseTools: Check GUID C structure format GUID C format must conform to {8,4,4,{2,2,2,2,2,2,2,2}} Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/Common/GlobalData.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'BaseTools/Source/Python/Common/GlobalData.py') diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Source/Python/Common/GlobalData.py index fac7cde708..57048bcae6 100644 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -66,6 +66,13 @@ 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) +## Regular expression for GUID c structure format +_GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \ + r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \ + r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \ + r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \ + r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar) +gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern)) # # A global variable for whether current build in AutoGen phase or not. -- cgit v1.2.3