Escape regular expression special characters.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md
appveyor.yml

README.md

Escape Regex (Deprecated)

Build Status Build status

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

Example

Use the escape function of the regex crate, instead of this crate.

extern crate regex;

let pattern = "123*456";
let escaped_pattern = regex::escape(pattern);

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

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

License

MIT