Test, validate and match regular expressions
Validates amateur radio (ham) callsigns and captures their components for prefix retrieval. It matches an optional slash-prefixed group (e.g., 'W/'), the callsign prefix (letter+digit, 1-2 letters, or digit+letter forms like '9A'), a numeric district, a letter suffix, and an optional trailing slash suffix such as '/P' or '/M'. Typical matches include W1AW, KA1ABC, 9A2XYZ, and G4ABC/P. Useful in logging software, contest apps, or DX cluster tools for verifying callsigns and extracting prefixes for country lookup.