From e25912758e2285b065169517d7bdbffddac303dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sun, 15 Jan 2023 02:05:05 +0100 Subject: [PATCH] v0.0.58 --- rext/wrapper.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rext/wrapper.go b/rext/wrapper.go index 298950d..fff3122 100644 --- a/rext/wrapper.go +++ b/rext/wrapper.go @@ -8,6 +8,7 @@ type Regex interface { MatchAll(haystack string) []RegexMatch ReplaceAll(haystack string, repl string, literal bool) string ReplaceAllFunc(haystack string, repl func(string) string) string + RemoveAll(haystack string) string GroupCount() int } @@ -71,6 +72,10 @@ func (w *regexWrapper) ReplaceAllFunc(haystack string, repl func(string) string) return w.rex.ReplaceAllStringFunc(haystack, repl) } +func (w *regexWrapper) RemoveAll(haystack string) string { + return w.rex.ReplaceAllLiteralString(haystack, "") +} + // GroupCount returns the amount of groups in this match, does not count group-0 (whole match) func (w *regexWrapper) GroupCount() int { return len(w.subnames) - 1