Replaces the hardcoded string replacement for numeric ranges with a more robust regex pattern that handles any combination of positive and negative numbers in default value ranges. Fixes #135470 Pull Request resolved: https://github.com/pytorch/pytorch/pull/140210 Approved by: https://github.com/ezyang