BaseTools: move regular expression compile out of function call.