Build, test, and debug regular expressions
This regex matches either a single whole number (e.g., '42') or a numeric range separated by a hyphen (e.g., '1-10'). The start number is captured in group 1, and if a hyphenated range is present, the end number is captured in group 2. It is commonly used for validating or parsing page numbers and page ranges, such as in document viewers, print dialogs, or citation parsing.