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
  • 607,720
  • 39
  • 448
  • 563
konrad
  • 3,544
  • 4
  • 36
  • 75

1 Answers1

2

This regex should work:

^\d+\.\d{3}$
Kirill Polishchuk
  • 54,804
  • 11
  • 122
  • 125