Test, validate and match regular expressions
Validates a 9-character Taxpayer Identification Number (TIN) composed only of digits and optional hyphen separators. Negative lookaheads ensure the value never starts or ends with a hyphen and contains no consecutive hyphens, so separators can only appear between digits. With the global/multiline flags, it checks each TIN on its own line, useful for bulk validation of identifiers like 123-456-78 or 123456789.