Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/tknf/japhonex-go
- Owner: tknf
- License: mit
- Created: 2022-03-12T12:02:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-12T14:07:18.000Z (over 2 years ago)
- Last Synced: 2024-06-20T13:34:08.812Z (5 months ago)
- Topics: go, japanese, phonenumber, regex
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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