this module generate one valid regex between two number.
- best and quick to generate regex
- simple generate regex between two digit or
garth than
andlower than
number - this module can work with negative numbers
this function get two number and generate regex from that you can used this regex in Javascript codes betweens(
gt
,lt
); result is garth thangt
number and lower thanlt
param. result type isjavascript regex
this function get one number and generate regex from that you can used this regex in Javascript codes maxThan(
gt
); result is garth thangt
number param. result type isjavascript regex
this function get one number and generate regex from that you can used this regex in Javascript codes minThan(
lt
); result is garth thanlt
number param. result type isjavascript regex
can use negative numbers in function
all function in this module return regex
<script type="text/javascript" src="regex-digit-between/lib/ES5/digitRegex.js"></script>
//todo -120 <= reg <= 230
var Nbetween = betweens(-120,230);
Nbetween.test("12"); //T
Nbetween.test("-289"); //F
Nbetween.test("-119"); //T
Nbetween.test("291"); //F
Nbetween.test("1005"); //F
Nbetween.test("-2450"); //F
Nbetween.test("-99"); //T
Nbetween.test("+91"); //T
Nbetween.test("+3460"); //T
Nbetween.test("-10050"); //F
//todo 290 <= reg <= 2459
var between = betweens(290,2459);
between.test("12"); //F
between.test("289"); //F
between.test("290"); //T
between.test("291"); //T
between.test("1005"); //T
between.test("2450"); //T
between.test("2459"); //T
between.test("2460"); //F
between.test("3460"); //F
between.test("10050"); //F
//todo 290 <= reg
var maxthan = maxThan(290);
maxthan.test("290"); //T
maxthan.test("120"); //F
maxthan.test("2345"); //T
maxthan.test("234"); //F
maxthan.test("145"); //F
maxthan.test("4099"); //T
//todo reg <= 2459
var minthan = minThan(2459);
minthan.test("2459"); //T
minthan.test("2460"); //F
minthan.test("2345"); //T
minthan.test("234"); //T
minthan.test("145"); //T
minthan.test("4099"); //F
import {digitRegex} from 'digitRegex';
//todo 290 <= reg <= 2459
let [
Nbetween,
betweens,
maxthan,
minthan
] = [
digitRegex.betweens(-120,230),
digitRegex.betweens(290,2459),
digitRegex.maxThan(290),
digitRegex.minThan(2459)
];
//todo -120 <= reg <= 230
var Nbetween = betweens(-120,230);
Nbetween.test("12"); //T
Nbetween.test("-289"); //F
Nbetween.test("-119"); //T
Nbetween.test("291"); //F
Nbetween.test("1005"); //F
Nbetween.test("-2450"); //F
Nbetween.test("-99"); //T
Nbetween.test("+91"); //T
Nbetween.test("+3460"); //T
Nbetween.test("-10050"); //F
//todo 290 <= reg <= 2459
var between = betweens(290,2459);
between.test("12"); //F
between.test("289"); //F
between.test("290"); //T
between.test("291"); //T
between.test("1005"); //T
between.test("2450"); //T
between.test("2459"); //T
between.test("2460"); //F
between.test("3460"); //F
between.test("10050"); //F
//todo 290 <= reg
var maxthan = maxThan(290);
maxthan.test("290"); //T
maxthan.test("120"); //F
maxthan.test("2345"); //T
maxthan.test("234"); //F
maxthan.test("145"); //F
maxthan.test("4099"); //T
//todo reg <= 2459
var minthan = minThan(2459);
minthan.test("2459"); //T
minthan.test("2460"); //F
minthan.test("2345"); //T
minthan.test("234"); //T
minthan.test("145"); //T
minthan.test("4099"); //F