html
html
1
2
3
<!-- Created by Roopesh -->
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
/* Created by Roopesh */
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Created by Roopesh
var regex = /^((?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:(?:\d(?:_\d)?)+\_?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?)/;
var validCases = [
"123",
"123_234_34",
"233_344_355e43",
"2_3_4"
];
for (test of validCases) {
console.log(`Testing: ${test}, Matched: ${test.match(regex)[0]}`);
}
console.log(2_3_4)
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run