Regex to extract IP and Hostname for the variable

Hello Folks, I would like to extract the IP address or the hostname from the list of targets that I have.

For example, if these two are the targets that I have:, what I want to extract is

d-bns-teaut-12 and

It would have been easy for me if my targets were either all in IP or all in FQDN but unfortunately I have a mix. So far I have reached till this regex : /([a-zA-Z0-9.-]+)/ . But if I try to match on ‘’ it will ignore my pure IP targets.

Hello :wave: and welcome to the forum, @ashishbnv

where are you using this regex? Inside value mapping? Can you include a screenshot of what you’re trying to accomplish?