Open danziamo opened 6 years ago
The pattern is bad, {1}
is superfluous and you are making the unit optional, so 1m
would match.
@piranna. Thank you. It really doesn't work. Any other working options?
const re = /^([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?) ?([KkMm]?[Hh][Zz])?$/
regex for frequency
2.34 MHz should match 1.56e4 Hz should match 55 should match .44Hz should match 144 MHz should match 0.24 MHz should match 44 z not match 144t not match