Build, test, and debug regular expressions
This regex extracts International Classification for Standards (ICS) codes from text, accommodating various formats like missing separators or varying levels of hierarchy (e.g., 01.040.01, 01.040, or just 01). It specifically validates the primary group numbers against the official ISO list and allows for placeholders like 'X'. It is useful for parsing and categorizing standardization documents where formatting might be inconsistent or slightly malformed.