package wildcard

import "github.com/moby/buildkit/util/wildcard"

Index

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.

Source Files

wildcard.go

Version
v0.21.0 (latest)
Published
Apr 11, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 days ago

Tools for package owners.