Skip to main content

Crate use_wildcard

Crate use_wildcard 

Source
Expand description

§use-wildcard

Simple wildcard matching helpers for RustUse.

Warning: versions below 0.3.0 are experimental and may change as the workspace matures.

§Example Usage

use use_wildcard::has_wildcard;

assert!(has_wildcard("report-*.txt"));

§Scope

  • lightweight * and ? matching helpers
  • conservative escaping and regex-string conversion
  • predictable string-based behavior for fixtures and tooling

§Non-Goals

  • full glob syntax
  • filesystem matching
  • regex engine implementation
  • shell expansion

§License

Licensed under either of the following, at your option:

  • MIT License
  • Apache License, Version 2.0

Structs§

WildcardPattern
A simple wildcard pattern with optional case-sensitivity metadata.

Functions§

ends_with_wildcard
Returns true when the last unescaped token is a wildcard.
escape_wildcard
Escapes wildcard metacharacters so they are treated literally.
has_wildcard
Returns true when the input contains an unescaped * or ?.
starts_with_wildcard
Returns true when the first unescaped token is a wildcard.
wildcard_matches
Returns true when the pattern matches the entire input.
wildcard_matches_case_insensitive
Returns true when the pattern matches the entire input after lowercasing both sides.
wildcard_to_regex
Converts a wildcard pattern into an anchored regex string.