regexp

package
v0.0.0-...-0716ad7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupByMatch

func LookupByMatch[T any](patterns map[Regexp]T, s string) (T, bool)

LookupByMatch scans <key, value> tuples `patterns` and returns the value whose key matches `s`.

Types

type Regexp

type Regexp struct {
	Pattern *regexp.Regexp
	// contains filtered or unexported fields
}

Regexp is a wrapper for regexp.Regexp that is also comparable. This type can be used as a key in maps: `map[Regexp]T`.

func Compile

func Compile(expr string) (*Regexp, error)

func (*Regexp) AppendText

func (re *Regexp) AppendText(b []byte) ([]byte, error)

AppendText implements encoding.TextAppender.

func (Regexp) MarshalText

func (re Regexp) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*Regexp) UnmarshalText

func (re *Regexp) UnmarshalText(text []byte) error

UnmarshalText implements encoding.UnmarshalText.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL