Convert a hexadecimal number (of any size) into a binary number.
Input
A POSITIVE hexadecimal number with a 0x
in the beginning. A valid input will always match the following regex: 0x[0-9a-fA-F]+
. If the input is not a valid hexadecimal number, that is, anything not matching this regex, the output should be 0
.
Output
The hexadecimal converted to binary.
Winning
Original Code-Golf Rules, Lowest amount of bites (bytes)
.
Examples
IN: 0x12
OUT: 10010
IN: 0xFF
OUT: 11111111
IN: 0XFF
OUT: 0
IN: #0ac4
OUT: 0
IN: 0x00101011
OUT: 100000001000000010001
IN: 0x525600
OUT: 10100100101011000000000
IN: 0x58f70555118ec400
OUT: 101100011110111000001010101010100010001100011101100010000000000
IN: 0x6669795966AF3000
OUT: 110011001101001011110010101100101100110101011110011000000000000
IN: 0b018474
OUT: 0
IN: 9577383
OUT: 0
IN: -483355
OUT: 0
IN: -0xf9ad92
OUT: 0
IN: 0xG
OUT: 0
IN: 0x0xa
OUT: 0
#0ac4
still a valid test case? \$\endgroup\$X
is uppercase). \$\endgroup\$00011010
\$\endgroup\$