wildcard

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package wildcard provides simple, safe string matching where only '*' is treated as a wildcard matching any sequence of characters (excluding newlines).

Example:

ok := wildcard.Match("foo*bar", "fooXYZbar")                // single
okAny := wildcard.Match("foo*bar", "nope", "fooZZZbar")     // any-of
okEmpty := wildcard.Match("foo*bar")                        // false (no inputs)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(pattern string, s ...string) bool

Match reports whether ANY of the provided strings match 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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