tools: fix regex strings in Python tools
Opening this to reland https://github.com/nodejs/node/pull/46585 but this time with the metadata required. Sorry for the mess this has turned out to be for a simple change, @josusky. I hope it's OK that I'm doing this on your behalf. (You're still the author on the commit here.)