pub fn string_find_value<T: Default + FromStr>(
input: &str,
patterns: &[&str],
) -> RUMResult<T>Expand description
Given a string input and a set of RegEx patterns, find the target value and return it as
the given target type T.
use rumtk_core::search::rumtk_search::string_find_value;
let haystack = "Range (min \\xe2\\x80\\xa6 max): 0.6 ms \\xe2\\x80\\xa6 2.9 ms 1273 runs";
let patterns = ["\\d+ runs", "\\d+"];
let expected = 1273;
let result = string_find_value::<usize>(haystack, &patterns);
assert_eq!(result, Ok(expected), "Did not find the needle in the haystack or returned the wrong type!");Use " " in join_pattern if you wish to have spaces in between matches.