Skip to content

Commit

Permalink
1.2.7 | Updated The IPV4 Regex #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew-Alleman committed Sep 30, 2023
1 parent 44fcf60 commit 6309b7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl DataSurgeon {
("credit_card", Regex::new(r"\b(\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4})\b").unwrap()),
("email", Regex::new(r"\b([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})\b").unwrap()),
("url", Regex::new(r#"(https?://(?:[^\s.,;:"'<>()\[\]{}]+\.)*[^\s.,;:"'<>()\[\]{}]+(/[^\s]*[^\s.,;:"'<>()\[\]{}\s])?)"#).unwrap()),
("ip_address", Regex::new(r"\b((?:\d{1,3}\.){3}\d{1,3}(?:/\d{1,2})?)\b").unwrap()),
("ip_address", Regex::new(r"\b((?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d)\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d)|(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d)\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d)\.(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d))(?::\d{1,5})?)\b").unwrap()),
("social_security", Regex::new(r"\b(\d{3}-\d{2}-\d{4})\b").unwrap()),
("phone_number", Regex::new(r"(\b[2-9]\d{2}-\d{3}-\d{4}\b)").unwrap()),
("ipv6_address", Regex::new(r"((?:[0-9a-fA-F]{1,4}:){1,7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:){1,5}(?::[0-9a-fA-F]{1,4}){1,2}|(?:[0-9a-fA-F]{1,4}:){1,4}(?::[0-9a-fA-F]{1,4}){1,3}|(?:[0-9a-fA-F]{1,4}:){1,3}(?::[0-9a-fA-F]{1,4}){1,4}|(?:[0-9a-fA-F]{1,4}:){1,2}(?::[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:(?:(?::[0-9a-fA-F]{1,4}){1,6})|:(?:(?::[0-9a-fA-F]{1,4}){1,7}|:))(?:/\d{1,3})?").unwrap()),
Expand Down

0 comments on commit 6309b7f

Please sign in to comment.