escape-regex

Crates.ioescape-regex
lib.rsescape-regex
version1.0.0
sourcesrc
created_at2019-01-07 10:29:57.060111
updated_at2019-01-07 10:29:57.060111
descriptionEscape regular expression special characters.
homepagehttps://magiclen.org/escape-regex
repository
max_upload_size
id106012
size11,400
Magic Len (Ron Li) (magiclen)

documentation

README

Escape Regex

Build Status Build status

Escape regular expression special characters in order to make it able to be concatenated safely by users.

Example

extern crate escape_regex;

extern crate regex;

use regex::Regex;

let pattern = "123*456";
let escaped_pattern = escape_regex::escape_string(pattern);

let reg = Regex::new(&escaped_pattern).unwrap();

assert_eq!(true, reg.is_match("0123*4567"));

Crates.io

https://crates.io/crates/escape-regex

Documentation

https://docs.rs/escape-regex

License

MIT

Commit count: 0

cargo fmt