1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
use regex::RegexSet;

/// Check if the provided **HTML** represents a valid
/// response from the server.
///
pub fn is_valid_html_response(html_string: &str) -> bool {
    let reg = RegexSet::new(&[
        r"Cédula",
        r"Nombre",
        r"Estado",
        r"Municipio",
        r"Parroquia",
        r"Centro",
        r"Dirección",
    ])
    .unwrap();

    let matches: Vec<_> = reg.matches(html_string).into_iter().collect();
    matches.len() == 7
}