Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tknf/japhonex-go

Japanese phone number checker for Go.
https://github.com/tknf/japhonex-go

go japanese phonenumber regex

Last synced: 8 days ago
JSON representation

Japanese phone number checker for Go.

Awesome Lists containing this project

README

        

# Japhonex Go

Japanese phone number checker for Go.

## Installation
```bash
$ go get github.com/tknf/japhonex-go
```

## Usage
In your Go app you can do something like:
```go
import (
"fmt"

"github.com/tknf/japhonex-go"
)

func main() {
result, err := japhonex.OptionalHyphen("")

if err != nil {
fmt.Println(err)
}

if result == true {
// validation is passed
}
}
```

### Hyphen validation patterns
### Optional
```go
result, err := japhonex.OptionalHyphen("")
// 0xx-xxxx-xxxx or 0xxxxxxxxxx
```
### Required
```go
result, err := japhonex.RequireHyphen("")
// 0xx-xxxx-xxxx
```
### No hyphen
```go
result, err := japhonex.NoHyphen("")
// 0xxxxxxxxxx
```

## Licence
MIT