Question:
Help me write a regular expression to write a number in any number system.
- The number can be signed (- or +) or unsigned.
- The number can be whole or fractional (, or.)
- Valid characters are 0-9, AZ.
I just started to deal with them. Before that, I analyzed everything in the code. But it somehow came out clumsy.
I have a limit – from binary to 36-ary
Answer:
^[-+]?[0-9A-Z]+[.,]?[0-9A-Z]*$