Templating: extract value

Running Grafana on prometheus, I want to create a row per target.
up{} return a list of string in the format of "up{instance=“184.72.121.26:9180”,job=“server”}
How should I extract only the IP value: “184.72.121.26” ?
I’m fine with doing it in the var def or the var usage.

Thanks
Tzach

You can use regex and a capture group. See this answer to an Influx query.

And here is an answer for Prometheus:

https://localhost:3000/t/using-regex-in-grafana-templating-how/859

Thanks, the following did the trick for me
/instance="(.):."/