Skip to content

Commit

Permalink
Cleaning up printlns
Browse files Browse the repository at this point in the history
  • Loading branch information
haydonryan committed Dec 8, 2024
1 parent 72523e9 commit 6e7478b
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/replace_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use regex::Regex;
pub fn convert_money_to_words(text: &str) -> String {
let re = Regex::new(r"\$1$").unwrap();
let search_text = re.replace_all(text, "one dollar").to_string();
println!("1: {}", search_text);

let re = Regex::new(r"\$([1-9][\.]*[0-9]*\s(million|billion|trillion))").unwrap();
let search_text = re.replace_all(&search_text, "$1 dollars").to_string();
println!("2: {}", search_text);

let re = Regex::new(r"\$(?<m>[,0-9]+)").unwrap();
re.replace_all(&search_text, "$m dollars").to_string()
Expand Down

0 comments on commit 6e7478b

Please sign in to comment.