0.1.1 • Published 6 years ago

@regexp-extra/float v0.1.1

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

RegExp for matching floating-point number.

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


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

FLOAT.test('12.31');
// true

var str = '1 canteen: 1000kg = Infinity mangoes';
str.match(FLOAT);
// [ '1', '1000', 'Infinity' ]

new RegExp(FLOAT).exec(str);
// [ '1',
//   '',         (sign)
//   '1',        (mantissa)
//   undefined,  (exponent)
//   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