[FX] Use precompiled regex in graph name processing (#52853)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/52853
ghstack-source-id: 122531132
Test Plan: waitforsadcastle
Reviewed By: anjali411
Differential Revision: D26668527
fbshipit-source-id: bd34d860cd3a71d3b29f2430df97a0501d542f5b