const regex = new RegExp('([023]3|[067]0|[1289]1|5[5689]|67|96|88|77|65|05)$|^(8|4[358]|7[147]|51|37|30)|865|349|2.{5}5|761|74[348]|728|811|990', 'gm')
const str = `1386551069
1721125688
871749537
3410748801
2935589455
1885865030
776296760
614705581
3841106923
434616334
1891651756
1128215653
256582433
310780133
3971028567
2349690078
489992769
493183796
3073937100
3968540100
777207799
515453341
487926468
2597442171
950819523
1881247391
3676486536
3852572850
3498953201
2544525180
297297258
3783570310
2485456860
2866433205
2638825384
2405115019
2734986756
3237895121
1560255677
4228599165
3106247743
742719206
2409129909
3008020402
328113612
1081997633
1583987616
1029888552
1375524867
3913611859
3488464791
732377595
431649729
2105108903
1454214821
997975981
1764756211
2921737100
754705833
1823274447
450215579
976175934
1991260870
710069849
28051484
408224582
1157838297
3470985950
1310525292
2739928315
3565721638
3568607641
3857889210
682782262
2845913801
2625196544
1036650602
3890793110
4276552453
2017874229
3935199786
1136100076
2406566087
496970764
2945538435
2830207175
4028712507
2557754740
572724662
2854602512
736902285
3612716287
2528051536
3801506272
164986382
1757334153
979200654
1377646057
1003603763
4217274922
3804763169
2502416106
698611315
3586620445
2343814657
3220493083
3505829324
4268209107
1798630324
1932820146
2356679271
1883645842
2495921085
2912113431
1519642783
924263219
3506109843
2916121049
4060307069
1470129930
4014068841
1755190161
311339709
473039620
2530217749
1297591604
3269125607
2834128510`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions