]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/FdfParserLite.py
BaseTools: FdfParser & FdfParserLite refactor regular expression for GUIDs
[mirror_edk2.git] / BaseTools / Source / Python / Common / FdfParserLite.py
index 7d129bfcab5909d77e4bd81918e5beea89580f62..df287414db6f6c847669001ff47eae27a79218d6 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # parse FDF file\r
 #\r
-#  Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -21,6 +21,7 @@ import Common.LongFilePathOs as os
 import CommonDataClass.FdfClass\r
 from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from Common.MultipleWorkspace import MultipleWorkspace as mws\r
+from Common.RangeExpression import RangeExpression\r
 \r
 ##define T_CHAR_SPACE                ' '\r
 ##define T_CHAR_NULL                 '\0'\r
@@ -931,8 +932,7 @@ class FdfParser(object):
         \r
         if not self.__GetNextToken():\r
             return False\r
-        p = re.compile('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}')\r
-        if p.match(self.__Token) != None:\r
+        if RangeExpression.RegGuidPattern.match(self.__Token) != None:\r
             return True\r
         else:\r
             self.__UndoToken()\r