Build, test, and debug regular expressions
Alternation matching three consecutive uppercase letters at the start of a line (via the multiline flag) or, as a second branch, an optional single 'D'/'d' character. Intended for extracting or validating a visa's country of issue as a three-letter ISO 3166-1 alpha-3 code, but the unanchored optional second branch also yields empty matches and stray 'd' matches anywhere in the input.