How to adjust the regex below to ignore network address and comments with # and just match hostname?
regex:
^((?!\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4}\b).)*$
string:
localhost,127.0.0.1
8.8.8.8;web
web2 # Comments
192.168.0.1,fw
output:
desired output:
- localhost
- web
- web2
- fw
