For my situation, I need to extract the IP address or the hostname from the list. For example, suppose this is the list
d-bns-teaut-12.corporate.net:9100, 10.212.142.61:9100, d-bns-teaut-23.corporate.net:9100, 10.212.142.87:9100, d-bns-teaut-25.corporate.net:9100, 10.212.142.98:9100
I need to extract
d-bns-teaut-12,10.212.142.61,d-bns-teaut-23,10.212.142.87,d-bns-teaut-25 and 10.212.142.98
So far I know how to extract either the IP or hostname, but not both with a regex at the same time.
I tried with the expression /([a-zA-Z0-9\.-]+)/
and with that I am able to extract the IP and if I add anymore regex patter to extract the .corporate.net
, I do not get the IP in the results.