Noob here, can you store regex result in variable to be used in query?

In a query where you have a regex matching certain services (icinga2 and graphite datasources) I need to store that value and reference it in another metric in the same query.

Goal here is to have a graph with all of the interface usage shown in one graph, not separate graphs for each interface…but that’s next.

For example:


In that example I need to save the value matched by /[Gigabit|Fast]Ethernet.*/ and use it in place of $regex_var_here

If that’s not really how I’m supposed to be doing it…please let me know.