wildcard

package
v0.0.0-...-2745715 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wildcard2Regexp

func Wildcard2Regexp(wildcard string) (string, error)

Wildcard2Regexp translates a wildcard string to a regexp string.

Types

type Match

type Match struct {
	Submatches []string // 0: the entire query, 1: the first submatch, 2: the second submatch, ...
	// contains filtered or unexported fields
}

Match is a matched result.

func (*Match) Format

func (m *Match) Format(f string) (string, error)

Format formats submatch strings like "$1", "$2".

func (*Match) String

func (m *Match) String() string

String implements fmt.Stringer.

type Wildcard

type Wildcard struct {
	// contains filtered or unexported fields
}

Wildcard is a wildcard matcher object.

func New

func New(s string) (*Wildcard, error)

New returns a wildcard object for a string that contains "*" symbols.

func (*Wildcard) Match

func (w *Wildcard) Match(q string) *Match

Match returns a non-nil Match on match.

func (*Wildcard) String

func (w *Wildcard) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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