s3rm-rs 1.3.2

Fast Amazon S3 object deletion tool.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use fancy_regex::Regex;

const INVALID_REGEX: &str = "Invalid regular expression";

pub fn parse_regex(regex: &str) -> Result<String, String> {
    if Regex::new(regex).is_err() {
        return Err(INVALID_REGEX.to_string());
    }

    Ok(regex.to_string())
}