๐ Find common expressions in a string
Table of Contents generated with DocToc
Add this to your Cargo.toml
[dependencies]
commonregex_rs = "0.1.0"
extern crate commonregex_rs;
use commonregex_rs::commonregex;
let logs = String::from("
Started GET '/' for 127.0.0.1 at 2019-05-11 00:51:35
Started GET '/' for 10.10.0.1 at 2019-05-11 00:52:05
");
let filtered_ips = commonregex::ip::v4(&logs);
// #=> vec!["127.0.0.1", "10.10.0.1"]
commonregex::internet::email(&text)
URL
commonregex::internet::url(&text)
IPv4
commonregex::ip::v4(&text)
IPv6
commonregex::ip::v6(&text)
French phone numbers
commonregex::phone::fr(&text)
US phone numbers
commonregex::phone::us(&text)
Full documentation is available here.
Please read CONTRIBUTING.md for information on how to contribute.
This project was inspired by commonregex.