threeDigitStr top-level property
The pattern used to match strings that consist of exactly three digits.
Pattern breakdown:
^and$: Anchors to ensure the entire string is matched.\d{3}: Exactly three digits from 0 to 9.
Pattern: ^\d{3}$
Implementation
String threeDigitStr = r'^\d{3}$';