Test, validate and match regular expressions
This regular expression matches strings that consist of exactly 1 to 4 digits (0-9) from start to finish. It is commonly used to validate numeric input such as years, ages, page numbers, or short numeric codes, ensuring the value is a whole number without leading signs or extra characters.