mapcode-regex

3.0.0 • Public • Published

mapcode-regex

Regular expression for matching mapcodes

Install

$ npm install mapcode-regex

Usage

import mapcodeRegex from 'mapcode-regex';

mapcodeRegex().test('4J.Q2');
//=> true

mapcodeRegex().test('Hawaii ZSR.3J');
//=> true

mapcodeRegex().exec('This is a mapcode FRA 4J.Q2')[0];
//=> 'FRA 4J.Q2'

'Multiple FRA 4J.Q2 Hawaii ZSR.3J mapcodes'.match(mapcodeRegex());
//=> ['FRA 4J.Q2', 'Hawaii ZSR.3J']

Tip

You can use clone-regexp to change the flags. In this case, maybe remove the global flag.

Related

  • mapcode - Find mapcodes in a string

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    125
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    125
  • 2.0.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i mapcode-regex

Weekly Downloads

125

Version

3.0.0

License

MIT

Unpacked Size

16.3 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus