I've been struggling to come up with a regular expression for validating decimal numbers of a specific length.
So far, I've tried using
pattern="[0-9]){1,2}(\.){1}([0-9]){2}"
, but this only works for numbers like 12.12
.
What I'm aiming for is a pattern validation for (13 digits).(6 digits) and also considering the total length.
Here's what I expect:
`1234567891123.123456` //true
`1234567891123123456` //false since it contains only numbers
`12345678911234.123456` //false because it has 14 digits before the decimal point
`1234567891123.1234567` //false due to having 13 digits before the decimal point
Can anyone suggest a more suitable regex that meets the criteria mentioned above?