Packt.CS7.SharedLibraryGR by Mark J Price

<PackageReference Include="Packt.CS7.SharedLibraryGR" Version="1.0.0.1" />

.NET API 5,120 bytes

 StringExtensions

public static class StringExtensions
using System.Text.RegularExpressions; namespace Packt.CS7 { public static class StringExtensions { public static bool IsValidXMLTag(this string input) { return Regex.IsMatch(input, "^<([a-z+)([^<]+)*(?:>(.*)<\\/\\1>|\\s+\\/>)$"); } public static bool IsValidPassword(this string input) { return Regex.IsMatch(input, "^[a-zA-Z0-9_-]{8,}$"); } public static bool IsValidHex(this string input) { return Regex.IsMatch(input, "^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$"); } } }