Build, test, and debug regular expressions
Matches a string containing exactly two 4-digit numbers separated by a hyphen, such as '2023-2024' or '1998-2005'. The ^ and $ anchors ensure the entire string must follow this format with no extra characters. Commonly used to validate year ranges, fiscal or academic year spans, and period notations in forms, citations, and documents.