This rule enforces consistent formatting for numerical ranges by discouraging the use of hyphens or en dashes between numbers. Instead, it recommends using the words "from" or "through" to express ranges, following Microsoft Style Guide conventions.
The motivation behind this rule is readability and clarity. While hyphens and dashes are common ways to express ranges, they can sometimes be ambiguous or harder to parse, especially in technical documentation. Using words like "from" or "through" makes the range explicit and eliminates potential confusion, particularly when dealing with negative numbers or complex numerical expressions.
Examples of what gets flagged:
✗ Incorrect:
- "Pages 5-10"
- "The temperature range was 20–30 degrees"
- "Select items 1 - 5"
✓ Correct:
- "Pages 5 through 10"
- "The temperature range was from 20 through 30 degrees"
- "Select items from 1 through 5"
The rule uses a regular expression pattern \b\d+\s?[-–]\s?\d+\b
to identify number ranges that use hyphens or en dashes, with or without surrounding spaces.