Closed pexcn closed 4 years ago
Required to match all TLDs, e.g.:
.com
.org
.co.jp
.co.uk
.com.hk
.space
.xn--q9jyb4c
.tw
References:
Regex example:
# https://regex101.com/r/QHHAPR/2
([^\.]+)\.(com|org|co.uk|hk)$
Code:
# maximum 1 dot allowed
grep -E '^[^\.]*\.?[^\.]*$' <file>
# must have only 1 dot
grep -E '^[^\.]*\.[^\.]*$' <file>
References:
adlist