regex

CSharp · Console

/Program.cs

using System;
using System.Text.RegularExpressions;
					
public class Program
{
	public static void Main()
	{
		Regex linkParser = new Regex(@"https:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.com\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)?", RegexOptions.Compiled | RegexOptions.IgnoreCase);
		string rawString = "some text with https://go.com link in it";
		foreach(Match m in linkParser.Matches(rawString))
			Console.WriteLine(m.Value);
	}
}
;