
Using re.compile() and saving the resulting regular expression object for reuse is more efficient when the expression will be used several times in a single program. [1] [1] https://docs.python.org/3/library/re.html#re.compile Change-Id: I5441b44d0bb034b7632e6805adbfd3d8895890ef