Function version_sync::check_contains_regex
source · pub fn check_contains_regex(
path: &str,
template: &str,
pkg_name: &str,
pkg_version: &str
) -> Result<(), String>
Expand description
Check that path
contain the regular expression given by
template
.
This function only checks that there is at least one match for the
template
given. Use check_only_contains_regex
if you want to
ensure that all references to your package version is up to date.
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
.