I'm having trouble writing a sed command do the following. I have a file that should only contain "valid" domain names. How I use with sed to remove any line that does not match an expression?
The following seems to match the lines I want to keep in the online tool I used, though I'm sure it could be written better.
^*.*[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,15}?$
The file
example.example.example.org
01.001.11.00.example.com
asdf-asdf-asdf-www.example.net
example
example.example.co.uk
(example)
example.photography
example.info
example/
example.
example</h1>
{example}
etc.
Expected output:
example.example.example.org
01.001.11.00.example.com
asdf-asdf-asdf-www.example.net
example.example.co.uk
example.photography
example.info
Thanks for the help.