package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(?i)^.*\.(.*\.[a-z]{0,3})|(?i)([a-z]{0,3}\..*\.[a-z]{0,3}|.*\.[a-z]{0,3})$$`)
var str = `ch.iqos.com
discoveriqos.com
faramentol.ro
foodhouse.md
futurosinhumo.com
ganaconpmi.com
getinfo.kr
heatnotburn.se
iqommunity.ro
iqosclub.cz
iqosclub.sk
iqosclubcanarias.com
iqosempfehlen.at
iqositalia.it
iqosphere.jp
iqossvc.kr
iqosveda.cz
iqosveda.sk
newcreations.kr
prohibicionmentolado2020.es
proibicao-mentol2020.pt
qreator.ro
referiqosmy.com
shareiqos.ch
timeforchanges.ch
tryiqos.kr
unsmoke.de
iqostravel.com
iqostage.jp
iqos-register.jp
mystartapp.org
iqosclub.ch
dimensions.kz
www.tryiqos.ru
www.timeforchanges.ch
www.testiqos.ch
readmodel.m.sogou.com
www.shareiqos.ch`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/