Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niksy/regex-oib
Regular expression for OIB.
https://github.com/niksy/regex-oib
Last synced: about 2 months ago
JSON representation
Regular expression for OIB.
- Host: GitHub
- URL: https://github.com/niksy/regex-oib
- Owner: niksy
- License: mit
- Created: 2015-01-27T20:12:11.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T20:16:01.000Z (almost 10 years ago)
- Last Synced: 2024-10-18T03:47:41.047Z (2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# regex-oib
Regular expression for [OIB](http://en.wikipedia.org/wiki/Personal_identification_number_(Croatia)).
## Installation
```sh
npm install regex-oib --save
```## Examples
```js
var oib = require('regex-oib');oib().test('12345678901'); // => true
oib().test('HR12345678901'); // => true
oib().test('123456789011'); // => falseoib().exec('HR12345678901');
// => [0] 'HR12345678901'
// => [1] '12345678901'
// => [2] '1'
```### Match groups
* `[0]`: full OIB, with leading international symbol (if provided)
* `[1]`: full OIB, without leading international symbols
* `[2]`: control number## License
MIT © [Ivan Nikolić](http://ivannikolic.com)