Test, validate and match regular expressions
Parses multi-port scrape target strings used in Grafana Agent / Prometheus annotation discovery, in the form host[:port];path[;key=value...];port[,...]. Captures the hostname (group 1), an optional source port (group 2), a path or label name (group 3), an optional key=value segment verified via a backreference to group 3 (group 4), the target scrape port (group 5), and any trailing comma-separated or semicolon-terminated data (group 6). With the gm flags it validates each line, e.g. 'localhost:9090;/metrics;8080' or 'node;/metrics;path=/metrics;9100'.