0.1.1 • Published 6 years ago

@regexp-extra/integer v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

RegExp for matching integer (decimal, hexadecimal).

const INTEGER = require('@regexp-extra/integer');
// -> regular expression (global)


INTEGER.test('cake');
// false

INTEGER.test('1231');
// true

var str = '1 canteen: 1000kg = 0x12C mangoes';
str.match(INTEGER);
// [ '1', '1000', '0x12C' ]

new RegExp(INTEGER).exec(str);
// [ '1',
//   '',   (sign)
//   '1',  (digits)
//   index: 0,
//   input: '1 canteen: 1000kg = 0x12C mangoes',
//   groups: undefined ]

NPM

credits: taken idea from substack/float-regex.

0.1.1

6 years ago

0.1.0

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago