globset

A Rust crate for matching one or more glob patterns against a path simultaneously

Library
Cargo
v0.4.20
68,658 stars
MIT OR Unlicense

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
85 /100 Excellent
Development Activity 76
Maintenance 96
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
81 /100 Excellent
Architecture 84
Code Quality 85
Innovation 75
Learning Curve 78

globset is a cross-platform Rust crate for glob pattern matching, distinguished by its ability to match many glob patterns against a single path simultaneously rather than testing each pattern one at a time. It works by compiling glob patterns into regular expressions and executing them through the regex crate, which lets it match large sets of patterns (as in a .gitignore-style ignore list) far faster than iterating over each glob individually. Maintained as part of Andrew Gallant’s (BurntSushi) ripgrep monorepo, globset is the pattern-matching engine underneath ripgrep’s own file filtering and the ignore crate’s directory-walking logic, and by download volume it is the more widely used of the two.

What You Get

  • Glob/GlobBuilder for compiling a single glob pattern into a matcher, with configuration for case sensitivity and literal path-separator semantics
  • GlobSet/GlobSetBuilder for combining many glob patterns into one matcher that tests a path against all of them simultaneously and returns which ones matched
  • Support for alternate ‘or’ globs (e.g. *.{foo,bar}), unlike Rust’s standard glob crate
  • Correct matching against non-UTF-8 file paths, important for cross-platform tools that must handle arbitrary filesystem bytes
  • An optional serde1 feature for (de)serializing Glob values, useful for loading glob patterns from configuration files

Common Use Cases

  • Implementing .gitignore-style ignore-pattern matching where many patterns must be checked against each candidate path efficiently
  • Building a file-search or linting tool that needs to filter files by one or more include/exclude glob patterns
  • Replacing per-pattern sequential glob matching (as with the glob crate) with a single combined matcher when checking many patterns against the same path repeatedly
  • Matching glob patterns loaded from a configuration file, using the serde1 feature to deserialize Glob values directly

Under The Hood

Architecture crates/globset/src/glob.rs (1,686 lines) implements the glob-to-regex compiler: it parses glob syntax (wildcards, character classes, brace alternation, literal separators) into an internal AST-like token sequence, then renders that into a regex-crate pattern string. crates/globset/src/lib.rs (1,307 lines) builds on that to provide the public Glob/GlobMatcher (single-pattern) and GlobSet/GlobSetBuilder (multi-pattern) types; GlobSet specifically concatenates many compiled glob-regexes into one RegexSet so a single execution pass can report every matching pattern’s index, which is the crate’s core performance idea. pathutil.rs handles path-normalization helpers needed for consistent cross-platform matching, fnv.rs provides a fast non-cryptographic hasher used internally, and serde_impl.rs implements the optional Serde (de)serialization support behind the serde1 feature. Tech Stack Pure Rust (edition 2024) with regex/regex-syntax and aho-corasick as its core matching dependencies, plus bstr for correct non-UTF-8 path handling; serde and log are optional, feature-gated dependencies rather than defaults. Benchmarks live in a separate benches directory using the bencher-style harness visible in the crate’s README performance numbers. Code Quality The crate has 27 inline #[test] functions across its five source files (13 in lib.rs alone, covering GlobSet construction and matching edge cases; 6 in glob.rs covering pattern-compilation correctness; 5 in serde_impl.rs), plus a benchmark suite that doubles as a performance regression check; CI runs through the shared ripgrep monorepo GitHub Actions workflow. As one of the older, most heavily downloaded crates in the ripgrep monorepo, its code has had years of production hardening across ripgrep, the ignore crate, and countless third-party consumers. API Design The single-glob API (Glob::new(pattern)?.compile_matcher()) is minimal and requires almost no setup for the common case; GlobSetBuilder follows the same builder pattern used throughout Rust’s ecosystem (.add() then .build()), so the multi-pattern API is a natural extension of the single-pattern one rather than a separate mental model, and the README’s direct performance comparisons against the glob crate make the tradeoffs explicit for users deciding between them.

Used by 18 apps in this directory

Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 1 weeks ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 1 weeks ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 1 weeks ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 1 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

39,975

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 1 weeks ago
Rust
77%
AGPL 3.0

Spacedrive

Collaboration · File Storage

39,041

One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.

View details
56
Repo Health
84
Technical
63
Dependency
Built with
Rust 77%
TypeScript 20%
Updated 2 months ago
Rust
93%
Other

Tabby

AI Code Assistants

33,892

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
58
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 3 months ago
Rust
50%
Apache 2.0

Vibe Kanban

AI Agents · AI Code Assistants · Project Management

28,209

A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.

View details
75
Repo Health
75
Technical
64
Dependency
Built with
Rust 50%
TypeScript 46%
Updated 2 weeks ago
Rust
32%
Other

Windmill

Automation · Developer Tools

18,043

Turn scripts into webhooks, workflows, and auto-generated UIs — the fastest self-hostable workflow engine, 13x faster than Airflow.

View details
91
Repo Health
82
Technical
65
Dependency
Built with
Rust 32%
TypeScript 24%
Svelte 22%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers