Skip to content

leo60228/const-regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

const-regex

Proc macro to match regexes in const fns. The regex must be a string literal, but the bytes matched can be any value.

The macro expects an &[u8], but you can easily use str::as_bytes.

const fn this_crate(bytes: &[u8]) -> bool {
    const_regex::match_regex!("^(meta-)*regex matching", bytes)
}

assert!(this_crate(b"meta-meta-regex matching"));
assert!(!this_crate(b"a good idea"));

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages