s3sync 1.58.6

Reliable, flexible, and fast synchronization tool for S3.
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())
}