Is it possible to apply regex to Dimension results

We are using Azure Metrics to get stats on SQL Elastic Pools. If I add dimensions it adds some really nice value because it will then break down the metric on a per SQL instance. Unfortunately this makes the panel rather ugly and hard to read. Is there any way I can apply a regex to what is returned or somehow access just the DB instance name from the dimension?

I did try using the available format legend aliases however none of them give me the SQL instance itself (the last part, after the last “/”).