in reply to Regex {3} matches 3 or more?
Yes, but in your case anywhere.
If you want to only match strings with exactly three digits you need anchors for start and end of string.
/^[0-9]{3}$/
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex {3} matches 3 or more?
by pritesh_ugrankar (Monk) on Sep 05, 2020 at 14:07 UTC |