wildcard

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package wildcard provides simple wildcard pattern matching for tool filtering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(name, pattern string) bool

Match reports whether the name matches the pattern.

  • Only '*' is special; it matches any run of characters (excluding newlines).
  • All other characters are literal. Matching is anchored to the full string.
  • With zero inputs, it returns false.

func MatchAll

func MatchAll(name string, patterns ...string) bool

MatchAll reports whether the name matches all of the patterns. See Match for details on matching behavior.

func MatchAny

func MatchAny(name string, patterns ...string) bool

MatchAny reports whether the name matches any of the patterns. See Match for details on matching behavior.

func MatchAnyExplicit

func MatchAnyExplicit(name string, patterns ...string) bool

MatchAnyExplicit reports whether the name matches any pattern, skipping the bare "*" wildcard. Use this for opt-in resolution where "*" means "all defaults" but should not satisfy explicit opt-in.

func MatchMultiline

func MatchMultiline(name, pattern string) bool

MatchMultiline reports whether the name matches the pattern. Like Match, but * also matches newlines (uses [\s\S]* instead of .*). Use this for matching content that may span multiple lines.

Types

This section is empty.

Jump to

Keyboard shortcuts

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