From b156052e6fbf13664e0a78d0189ae9114ffb2d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Wed, 29 Mar 2023 19:53:53 +0200 Subject: [PATCH] v0.0.97 --- rext/wrapper.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rext/wrapper.go b/rext/wrapper.go index 08032a5..f17e6ee 100644 --- a/rext/wrapper.go +++ b/rext/wrapper.go @@ -1,6 +1,9 @@ package rext -import "regexp" +import ( + "gogs.mikescher.com/BlackForestBytes/goext/langext" + "regexp" +) type Regex interface { IsMatch(haystack string) bool @@ -156,6 +159,13 @@ func (g OptRegexMatchGroup) ValueOrEmpty() string { return g.v.Value() } +func (g OptRegexMatchGroup) ValueOrNil() *string { + if g.v == nil { + return nil + } + return langext.Ptr(g.v.Value()) +} + func (g OptRegexMatchGroup) IsEmpty() bool { return g.v == nil }