pub fn glob_with(glob: &str, opts: &PatternOpts) -> Result<Pattern, PatternError> {
        let result: IResult<&str, String> = Self::glob_to_regex(Scope::TopLevel, glob);
        match result {
            Ok((remaining, regex)) if remaining.is_empty() => {
                Self::regex_with(regex.as_str(), opts)
            }
            Ok((remaining, _)) => Err(PatternError {
                input: glob.to_string(),
                cause: format!(
                    "Unexpected '{}' at end of input",
                    remaining.chars().next().unwrap()
                ),
            }),
            Err(e) => Err(PatternError {
                input: glob.to_string(),
                cause: e.to_string(),
            }),
        }
    }
/// Creates `Pattern` instance from a Unix extended glob.
///
/// Glob patterns handle the following wildcards:
/// - `?`: matches any character
/// - `*`: matches any sequence of characters except the directory separator
/// - `**`: matches any sequence of characters
/// - `[a-z]`: matches one of the characters or character ranges given in the square brackets
/// - `[!a-z]`: matches any character that is not given in the square brackets
/// - `{a,b}`: matches exactly one pattern from the comma-separated patterns given inside the curly brackets
/// - `@(a|b)`: same as `{a,b}`
/// - `?(a|b)`: matches at most one occurrence of the pattern inside the brackets
/// - `+(a|b)`: matches at least occurrence of the patterns given inside the brackets
/// - `*(a|b)`: matches any number of occurrences of the patterns given inside the brackets
/// - `!(a|b)`: matches anything that doesn't match any of the patterns given inside the brackets
///
/// Use `\` to escape the special symbols that need to be matched literally. E.g. `\*` matches
/// a single `*` character.
///
Creates `Pattern` instance from a Unix extended glob.

Use `\` to escape the special symbols that need to be matched literally.
Creates ` Pattern ` instance from a Unix extended glob . Use ` \ ` to escape the special symbols that need to be matched literally .
pub fn glob_with(glob: &str, opts: &PatternOpts) -> Result<Pattern, PatternError> {
        let result: IResult<&str, String> = Self::glob_to_regex(Scope::TopLevel, glob);
        match result {
            Ok((remaining, regex)) if remaining.is_empty() => {
                Self::regex_with(regex.as_str(), opts)
            }
            Ok((remaining, _)) => Err(PatternError {
                input: glob.to_string(),
                cause: format!(
                    "Unexpected '{}' at end of input",
                    remaining.chars().next().unwrap()
                ),
            }),
            Err(e) => Err(PatternError {
                input: glob.to_string(),
                cause: e.to_string(),
            }),
        }
    }
pub fn glob_with ( glob : & str , opts : & PatternOpts ) -> Result < Pattern , PatternError > { let result : IResult < & str , String > = Self :: glob_to_regex ( Scope :: TopLevel , glob ) ; match result { Ok ( ( remaining , regex ) ) if remaining . is_empty ( ) => { Self :: regex_with ( regex . as_str ( ) , opts ) } Ok ( ( remaining , _ ) ) => Err ( PatternError { input : glob . to_string ( ) , cause : format ! ( " " remaining chars ( ) next ( ) unwrap ( ) ) , } ) , Err ( e ) => Err ( PatternError { input : glob . to_string ( ) , cause : e . to_string ( ) , } ) , } }
Creates `Pattern` instance from a Unix extended glob.
Creates ` Pattern ` instance from a Unix extended glob .
glob
&str
opts
&PatternOpts
glob
&str
opts
&PatternOpts