[][src]Function version_sync::check_contains_regex

pub fn check_contains_regex(
    path: &str,
    template: &str,
    pkg_name: &str,
    pkg_version: &str
) -> Result<(), String>

Check that path contain the regular expression given by template.

The placeholders {name} and {version} will be replaced with pkg_name and pkg_version, if they are present in template. It is okay if template do not contain these placeholders.

The matching is done in multi-line mode, which means that ^ in the regular expression will match the beginning of any line in the file, not just the very beginning of the file.

Errors

If the regular expression cannot be found, an Err is returned with a succinct error message. Status information has then already been printed on stdout.