A field that needs to be inputted must be in the exact form 6 numbers . four numbers
so for example 123456.0001
Any help greatly appreciated.
Use this:
if (/^\d{4}\.\d{6}$/m.test(yourString)) {
// It matches!
} else {
// Nah, no match...
}
Explanation
^ anchor asserts that we are at the beginning of the string\d{4} matches four ASCII digits\d{6} matches six ASCII digits$ anchor asserts that we are at the end of the string