This commit is contained in:
Mike Schwörer 2023-03-29 19:53:53 +02:00
parent dda2418255
commit b156052e6f
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -1,6 +1,9 @@
package rext package rext
import "regexp" import (
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"regexp"
)
type Regex interface { type Regex interface {
IsMatch(haystack string) bool IsMatch(haystack string) bool
@ -156,6 +159,13 @@ func (g OptRegexMatchGroup) ValueOrEmpty() string {
return g.v.Value() 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 { func (g OptRegexMatchGroup) IsEmpty() bool {
return g.v == nil return g.v == nil
} }