Create variable which only shows part of the tag value

Hey,
i’m using Grafana 7.5 and influxDB 2.0 and I’m trying to get a variable which only contains a part of a Tag value.

I use the following options:

The Query returns all the tag values which look like this:
Machine_Number/Machine_Name1/Machine_Name2/Sensortype/unit

I only want to get the part with “Machine_Name1/Machine_Name2”

Is there a way to achive something like this?
Thank you for your help in advance