0

Is there a way to verify with Regex that a string matches a patter like so:

  • 1.001
  • 1.002
  • 15.001

Where the pattern is:

  • any number followed by
  • dot character
  • followed by three (3) numbers

Given that patters things like this would fail:

  • A.001
  • 1.0001
  • 1,001 ...

Any help is appreciated.

Wiktor Stribiżew
  • 561,645
  • 34
  • 376
  • 476
konrad
  • 3,332
  • 4
  • 32
  • 64

1 Answers1

2

This regex should work:

^\d+\.\d{3}$
Kirill Polishchuk
  • 52,773
  • 10
  • 120
  • 121