using System.Linq;
using System.Text.RegularExpressions;
namespace Jovian.InspectorTools
{
public static class MyRegex
{
public const string WholeNumber = @"^-?\d+$";
public const string FloatingNumber = @"^-?\d*(\.\d+)?$";
public const string AlphanumericWithoutSpace = @"^[a-zA-Z0-9]*$";
public const string AlphanumericWithSpace = @"^[a-zA-Z0-9 ]*$";
public const string Email = @"^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})*$";
public const string URL = @"(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)";
///
/// Replace all but matching parts of the input string
///
public static string KeepMatching(this Regex regex, string input) => regex.Matches(input).Cast()
.Aggregate(string.Empty, (a, m) => a + m.Value);
}
}