Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust simple search and replace regex

use regex::Regex;

fn word_replace(str: &str) -> String {
    let re = Regex::new(r"word").unwrap();
    re.replace_all(&str, "****").to_string()
}
// Find each instance of "word" in a string and replace with something else.
 
PREVIOUS NEXT
Tagged: #rust #simple #search #replace #regex
ADD COMMENT
Topic
Name
4+1 =