PS: The .NET Methods have been implemented like this:
//<summary>RegEx function that does a search and replace
/// </summary>
/// <param name="input">Input string to search</param>
/// <param name="pattern">Pattern to look for in input string</param>
/// <param name="replace">String to insert as replacement for pattern</param>
/// <returns>string: input string where the pattern has been replaced with the replace string</returns>
public static string RegExReplace(string input, string pattern, string replace)
{
return Regex.Replace(input, pattern, replace);
}
//<summary>RegEx function that looks for a pattern in a string
/// </summary>
/// <param name="input">Input string to search</param>
/// <param name="pattern">Pattern to look for in input string</param>
/// <returns>bool: returns true if the pattern is found in the input string</returns>
public static bool RegExIsMatch(string input, string pattern)
{
return Regex.IsMatch(input, pattern);
}
//<summary>RegEx function that looks for a pattern in a string and returns the found pattern
/// </summary>
/// <param name="input">Input string to search</param>
/// <param name="pattern">Pattern to look for in input string</param>
/// <returns>string: returns the first found pattern in the input string</returns>
public static string RegExFirstMatch(string input, string pattern)
{
Match m = Regex.Match(input, pattern);
if (m.Success)
return m.Value;
else
return "";
}