# Matching Wildcards in Rust

**URL:** <https://forum.devtalk.com/t/matching-wildcards-in-rust/210485>\
**Category:** Backend Libraries/Tools\
**Tags:** rust, article\
**Created:** [12 August 2025 00:22 UTC](https://forum.devtalk.com/t/matching-wildcards-in-rust/210485 "2025-08-12T00:22:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirkjkrauss](https://forum.devtalk.com/user_avatar/forum.devtalk.com/kirkjkrauss/32/8367_2.png) [@kirkjkrauss](https://forum.devtalk.com/u/kirkjkrauss)\
**Post date:** [12 August 2025 00:22 UTC](https://forum.devtalk.com/t/matching-wildcards-in-rust/210485/1 "2025-08-12T00:22:22Z")

</div>

I’m not the first developer to code a method dedicated to matching the classic ‘\*’ and ‘?’ wildcards in Rust.&nbsp; But I may be the first to code an all-logic algorithm for that purpose – in this case, an algorithm informed by performance and testcase suggestions from many folks in the C/C++ developer community,

All that was needed, algorithmically speaking, was a logic tweak to fit Rust-style text content.&nbsp; The result: a pair of functions, one for matching wildcards in ASCII text (fast!), and another, based on the same algorithm, that’s UTF-8-ready.&nbsp; The code is [available](https://github.com/kirkjkrauss/MatchingWildcardsInRust) on GitHub.

Though the [original C/C++ code](https://github.com/kirkjkrauss/MatchingWildcards) works only for ASCII text strings, Rust has made a UTF-8-enabled implementation as simple as using a built-in data type.&nbsp; New UTF-8 testcases are provided with the Rust code.&nbsp; A [description](https://developforperformance.com/MatchingWildcardsInRust.html) of the algorithm’s history, the process of converting it to Rust, some philosophy legitimizing the conditional logic approach, and the development of the UTF-8 testcases, all appear at [developforperfromance.com](https://developforperformance.com/index.html).
