using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?i)^.*\.(.*\.[a-z]{0,3})|(?i)([a-z]{0,3}\..*\.[a-z]{0,3}|.*\.[a-z]{0,3})$$";
string input = @"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";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx