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
  • 484,719
  • 26
  • 302
  • 397
konrad
  • 3,092
  • 3
  • 28
  • 58

1 Answers1

2

This regex should work:

^\d+\.\d{3}$
Kirill Polishchuk
  • 51,053
  • 10
  • 118
  • 119