Skip to content

fakenine/commonregex-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

commonregex-rs

๐Ÿ”Ž Find common expressions in a string

Table of Contents generated with DocToc

Installation

Add this to your Cargo.toml

[dependencies]
commonregex_rs = "0.1.0"

Usage

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"]

Features

Internet

Email

commonregex::internet::email(&text)

URL

commonregex::internet::url(&text)

IP Addresses

IPv4

commonregex::ip::v4(&text)

IPv6

commonregex::ip::v6(&text)

Phone numbers

French phone numbers

commonregex::phone::fr(&text)

US phone numbers

commonregex::phone::us(&text)

Documentation

Full documentation is available here.

Contributing

Please read CONTRIBUTING.md for information on how to contribute.

Notes

This project was inspired by commonregex.