| | | 1 | | using System.Text.RegularExpressions; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Util.RegularExpressions; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Extension helpers for <see cref="Regex"/> operations. |
| | | 7 | | /// </summary> |
| | | 8 | | public static class RegexExtensions |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// Removes all matches of the provided <see cref="Regex"/> from <paramref name="string"/>. |
| | | 12 | | /// </summary> |
| | | 13 | | /// <param name="regex">The regex whose matches will be removed.</param> |
| | | 14 | | /// <param name="string">Input text.</param> |
| | | 15 | | /// <returns>The input text with all matches replaced by an empty string.</returns> |
| | 5 | 16 | | public static string Remove(this Regex regex, string @string) => regex.Replace(@string, string.Empty); |
| | | 17 | | } |