using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"((?:http:\/\/+|www\.+|https:\/\/+)(?:\W+|\S+|\s+|.+)(?:\.net+|\.ro+))";
string input = @"glass shoes door window door glasses. window glasses sunglasses
glass
asdblog
{www.asdblog.iqads.net}
{http://creator.iqads.ro/NESCAFE3in1}
http://twitter.com/share
http://cdn.iqads.ro/photos/tags/11912.png
http://cluj.tecomm.ro/
http://www.godmother.ro
http://www.facebook.com/godmotherBTL
http://twitter.com/share
http://media.iqads.ro/2015/10/rm2hb-cover-400.jpg
http://media.iqads.ro/2015/09/vv-cover-800-cover-400.jpg
http://media.iqads.ro/2015/08/razvan-mitoiu-photo-cover-400.jpg
http://media.iqads.ro/2015/06/dsc7179-cover-400.jpg
http://media.iqads.ro/2015/05/raluca2-cover-400.jpg
http://media.iqads.ro/2015/05/1me-cover-400.jpg
http://cdn.iqads.ro/photos/tags/263355.png
http://cdn.iqads.ro/photos/tags/32786.png
http://cdn.iqads.ro/photos/tags/22703.png
http://cdn.iqads.ro/photos/tags/23589.png
http://cdn.iqads.ro/photos/tags/228683.png
http://cdn.iqads.ro/photos/tags/23696.png
http://cdn.iqads.ro/photos/tags/16968.png
http://cdn.iqads.ro/photos/tags/263192.png
http://www.blueidea.ro
http://www.blueidea.ro";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
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