glob

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package glob is the blocklist matcher: case-insensitive `*` wildcards, shared by the notification blocklist and the systray blacklist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindWildcard

func FindWildcard(patterns []string, values []string, text string) (string, bool)

FindWildcard is the value of the first pattern that matches text, in the given order.

func Fold

func Fold(text, pattern string) bool

Fold reports whether the text lowercased is equal to the (already lowercased) pattern, or matching it as a glob.

func Glob

func Glob(pattern, text string) bool

Glob reports whether text matches pattern case-sensitively, as the hyprland workspace ignore list uses it: an invalid pattern never matches.

func Match

func Match(pattern, name string) bool

Match reports whether name matches the wildcard pattern.

func Wildcard

func Wildcard(pattern, text string) bool

Wildcard matches case-sensitively and byte-wise: `*` for any run and `?` for exactly one byte, `\` escaping one of `*`, `?`, `\`. A malformed pattern (a dangling or needless escape) never matches.

Types

type Pattern

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

Pattern is a compiled glob, for callers that match one pattern against many texts (the launcher's glob matching).

func Compile

func Compile(pattern string) (Pattern, bool)

Compile compiles pattern: false for a syntax error (a `***`, a `**` that is not a whole path component, an unterminated `[`).

func (Pattern) Matches

func (p Pattern) Matches(text string, caseSensitive bool) bool

Matches reports whether text matches: `*` crosses separators, no leading-dot rule, and ASCII-only case folding unless caseSensitive.

Jump to

Keyboard shortcuts

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