Problem/Motivation
In #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date we might be adding yet another regular expression to manipulate semantic versions.
It's suggested that we find such regexes and put them in one place, perhaps a component, for visibility and maintainability.
Proposed resolution
Decide on what to do.
Do it.