BaseTools: Use precompiled RegExp