numericRegStr top-level property
The pattern used to match whole integer numbers (optionally negative).
Pattern breakdown:
^and$: Anchors to match the entire string.-?: Optional minus sign for negative numbers.[0-9]+: One or more digits.
Pattern: ^-?[0-9]+$
Implementation
String numericRegStr = r'^-?[0-9]+$';