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: d-bns-teaut-12.corproot.net:9100 10.212.142.61:9100, what I want to extract is

d-bns-teaut-12 and 10.212.142.61.

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 ‘corproot.net’ 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?