Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niksy/regex-jmbg
Regular expression for JMBG.
https://github.com/niksy/regex-jmbg
Last synced: about 2 months ago
JSON representation
Regular expression for JMBG.
- Host: GitHub
- URL: https://github.com/niksy/regex-jmbg
- Owner: niksy
- License: mit
- Created: 2015-01-27T20:04:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T20:09:10.000Z (almost 10 years ago)
- Last Synced: 2024-10-27T00:16:57.089Z (2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# regex-jmbg
Regular expression for [JMBG](http://en.wikipedia.org/wiki/Unique_Master_Citizen_Number).
## Installation
```sh
npm install regex-jmbg --save
```## Examples
```js
var jmbg = require('regex-jmbg');jmbg().test('1304005111059'); // => true
jmbg().test('3213973392147'); // => falsejmbg().exec('1304005111059');
// => [0] '1304005111059'
// => [1] '13'
// => [2] '04'
// => [3] '005'
// => [4] '11'
// => [5] '105'
// => [6] '9'
```### Match groups
* `[0]`: full JMBG
* `[1]`: day of birth
* `[2]`: month of birth
* `[3]`: last three digits of the year of birth
* `[4]`: political region of birth
* `[5]`: unique number of the particular political region
* `[6]`: control number## License
MIT © [Ivan Nikolić](http://ivannikolic.com)