# tzdata-coordinate-regex

> A regular expression for time zone coordinates in zone.tab format

Latest version **2.0.0** (published 2018-09-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install tzdata-coordinate-regex
pnpm add tzdata-coordinate-regex
yarn add tzdata-coordinate-regex
bun add tzdata-coordinate-regex
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-09-09 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | regex, regexp, tz, tzdata, time, zone, timezone, coordinate, coordinates, lat, latitude, lon, lng, long, longitude, iso6709, match, validate, validation |

## Links

- npm: https://www.npmjs.com/package/tzdata-coordinate-regex
- Repository: https://github.com/shinnn/tzdata-coordinate-regex
- Homepage: https://github.com/shinnn/tzdata-coordinate-regex#readme
- Issues: https://github.com/shinnn/tzdata-coordinate-regex/issues
- npm.io page: https://npm.io/package/tzdata-coordinate-regex

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-09-09
- 2.0.0-2 — 2018-09-07
- 2.0.0-1 — 2018-09-01
- 2.0.0-0 — 2017-07-27
- 1.0.1 — 2017-04-19
- 1.0.0 — 2016-06-03
- 0.0.0 — 2016-06-03

## README

# tzdata-coordinate-regex

[![npm version](https://img.shields.io/npm/v/tzdata-coordinate-regex.svg)](https://www.npmjs.com/package/tzdata-coordinate-regex)
[![Build Status](https://travis-ci.org/shinnn/tzdata-coordinate-regex.svg?branch=master)](https://travis-ci.org/shinnn/tzdata-coordinate-regex)

A regular expression for time zone coordinates in [zone.tab](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) format

```javascript
tzdataCoordinateRegex.test('+313200+0350542'); //=> true
tzdataCoordinateRegex.test('+3843-00908'); //=> true
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install tzdata-coordinate-regex
```

## API

```javascript
import tzdataCoordinateRegex from 'tzdata-coordinate-regex';
```

### tzdataCoordinateRegex

Type: `RegExp`

It matches time zone coordinates in [tz database](https://www.iana.org/time-zones) format:

> Latitude and longitude of the zone's principal location in [ISO 6709](https://www.iso.org/iso/catalogue_detail.htm?csnumber=39242) sign-degrees-minutes-seconds format, either `+-DDMM+-DDDMM` or `+-DDMMSS+-DDDMMSS`, first latitude (`+` is north), then longitude (`+` is east).

```javascript
tzdataCoordinateRegex.exec('+4254-07436');
/*=> [
  '+4254-07436',
  '+',
  '42',
  '54',
  undefined,
  '-',
  '074',
  '36',
  undefined,
  index: 0,
  input: '+4254-07436',
  groups: {
    latitudeSeconds: undefined,
    longitudeSeconds: undefined
  }
] */

tzdataCoordinateRegex.exec('-353916+1394441');
/*=> [
  '-353916+1394441',
  '-',
  '35',
  '39',
  '16',
  '+',
  '139',
  '44',
  '41',
  index: 0,
  input: '-353916+1394441',
  groups: {
    latitudeSeconds: '16',
    longitudeSeconds: '41'
  }
] */
```

## License

[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe

---
_Source: https://npm.io/package/tzdata-coordinate-regex · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
