Named text and value capture groups variable

Hi all,

I have a problem to understand the correct usage of named text and value capture groups for variables.

I have a set of data like this “hostname.domain.net|192.168.0.1” where I’d like to have a dropdown box for the user to select the host and use the corresponding ip address in other charts. As you can see the two information are separated by ‘|’.

In order to separate the different information stored in this string I have created a regex

/(?<text>.*)\||\|(?<value>.*)/g

This shows only the hostname in the dropdown box.

How can I use the value (IP-Address / <value>) after the user has selected the hostname? Will the selection in the dropdown box create a new variable I can use in other charts or how can I access the value field.

thanks
horst

OK, solved. It was, as expected, the regex.

Correct regex would be:/(?<text>.*)\|(?<value>.*)/gm