japhonex

Crates.iojaphonex
lib.rsjaphonex
version0.1.1
sourcesrc
created_at2022-03-12 13:30:58.454383
updated_at2022-03-12 14:03:43.259736
descriptionJapanese phone number checker for Rust
homepagehttps://github.com/tknf/japhonex-rust
repositoryhttps://github.com/tknf/japhonex-rust
max_upload_size
id548765
size5,381
mast1ff (mast1ff)

documentation

README

Japhonex Rust

Japanese phone number checker for Rust.

Installation

[dependencies]
japhonex = "0.1"

Usage

In your Go app you can do something like:

extern crate japhonex;
use japhonex::japhonex;
use japhonex::HyphenCheck;

fn main () {
    let r = japhonex(HyphenCheck::Optional);

    r.is_match("<your input>");
}

Hyphen validation patterns

Optional

let r = japhonex(HyphenCheck::Optional);
// 0xx-xxxx-xxxx or 0xxxxxxxxxx

Required

let r = japhonex(HyphenCheck::Required);
// 0xx-xxxx-xxxx

No hyphen

let r = japhonex(HyphenCheck::NoCheck);
// 0xxxxxxxxxx

Licence

MIT

Commit count: 3

cargo fmt