html
html
1
2
3
<!-- Created by Roopesh -->
<!-- no html -->
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
/* Created by Roopesh */
/* no css */
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// 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(?:_)?)+n|NaN|Infinity)\b|(?:(?:\d(?:_)?)+\.?(?:\d(?:_)?)*|\B\.(?:\d(?:_)?)+)(?:[Ee][+-]?(?:\d(?:_)?)+)?)/;
// all the following test cases are true and regex should return them entirely
var validCases = [
"NaN",
"Infinity",
// hex
"0x09af",
"0x0ff_345_abc_def",
"0x0ff_fff_ffff_ff30ff_ffffn",
"0X0ff_345_abc_def",
// binary
"0b100101",
"0b0011_11011_1111_011",
"0b001_010_110_001_0110_010_10n",
"0B01110100101001",
// octal
"0o1234237",
"0o1725_1123_34467_234",
"0o243_435_6754_4367n",
"0O12345465563546536",
// scientific notaion
"1e6",
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run