8000 GitHub - mpalmer/regex-static: Compile-time validated regex, with convenience functions for lazy and static regexes.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compile-time validated regex, with convenience functions for lazy and static regexes.

Notifications You must be signed in to change notification settings

mpalmer/regex-static

8000
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regex_static

Compile-time validation of regex::Regex.

Examples

Lazy regex

Uses once_cell to lazily create the regex.

static RE: Lazy<Regex> = regex_static::lazy_regex!("^yesss$");

Static regex

Also uses once_cell, but works inline (will therefore reuse the same instance of the regex each function call).

let some_regex = regex_static::static_regex!("^yesss$");

Ordinary regex

Will create an owned Regex, just like calling Regex::new(...) but with compile-time validation.

let ordinary_regex = regex_static::regex!("^yesss$");

About

Compile-time validated regex, with convenience functions for lazy and static regexes.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%
0