Avatar of sirbounty
sirbounty
Flag for United States of America

asked on 

regular expression - parent domain only

Looking for a regex that will match the parent domain only.
in examples like the following
abcdefg.com   =  abcdefg.com
abcdefg.cn  =      abcdefg.cn
abc.def.org   =  def.org
abc-def.ghi.uk  = ghi.uk

This is the output of a cmdlet that won't produce any http:// prefix, nor any trailing pages - just the domain info, but I only want to extract the parent. Thanks!
Regular Expressions

Avatar of undefined
Last Comment
sirbounty

8/22/2022 - Mon