using System;
using System.Text;
using System.Text.RegularExpressions;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
//this regular expression grab text between [] or <> characters
string urlMatchRegex = "((?<=\\[).*?(?=\\]))|((?<=<).*?(?=>))";
//a variable to store our modifications to the clipboard
StringBuilder builder = new StringBuilder();
//search the text for URLs
foreach(Match match in Regex.Matches(text, urlMatchRegex, RegexOptions.IgnoreCase))
{
//a check to make sure we found a URL
if(match.Length == 0)
continue;
//add the URL to the variable
builder.AppendLine(match.ToString());
}
//return our modified text to the clipboard
return builder.ToString();
}
}