@cjser/mapcode-regex
v3.0.0-cjser.2
Published
Regular expression for matching mapcodes
Downloads
22
Maintainers
Readme
mapcode-regex
Regular expression for matching mapcodes
Install
$ npm install mapcode-regexUsage
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
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/mapcode-regex
