Skip to content
/ nopol Public

Go package to check and format Indonesian vehicle registration number (police number)

License

Notifications You must be signed in to change notification settings

matriphe/nopol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nopol

Build Status

Nopol is Go package to check and format Indonesian vehicle registration number (police number).

It will format vehicle registration number format like this {XX} {DDDD} {YYY}, for example AD 6742 DZ, CD 129 or RI 1.

For more info about Indonesian vehicle registration number, please refer to the Wikipedia.

Installation

go get -u github.com/matriphe/nopol

Usage

// Check validation
val := nopol.IsValid("AB 1234 XYZ") // return true
val := nopol.IsValid("ABC 12345") // return false

// Format
f, err := nopol.Format("AB1234-XYZ") // return AB 1234 XYZ, nil
f, err := nopol.Format("ABC12345") // return "", Not a valid police number

For more info, refer to this documentation.

To Do

  • Get information from the vehicle registration number
  • Check validity of the vehicle registration number

License

The MIT License (MIT). Please see License File for more information.

About

Go package to check and format Indonesian vehicle registration number (police number)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages