Test, validate and match regular expressions
This regex matches a line containing an optional sequence of digits, an optional hyphen, and another optional sequence of digits. It's often used to validate simple range formats or optional negative numbers, though it will also match empty strings, isolated hyphens, and strings with trailing dashes. The multiline flag ensures it tests each line individually.