Can you regex part of a variable in a series?

We have some variables, e.g., $env:prod, $env:prod-custom. I’d like to have some of my metrics configured to use just $env, but others to use only what comes before - in the $env variable.

e.g., consider the following two examples:


If I have the $env variable selected as $env == prod-custom, I’d like a way to make it so that the following are the literal series used:

Is there a way to do this?