Explicit rules:
The string has two parts, separated using a semicolon.
The first part is allowed to have alphanumeric characters, dashes, underscores and dots
The second part of the string contains key-value pairs where key is set to its value using an equality sign and the pairs are comma separated and we don't know how many times they're repeated beforehand
Examples:
blahblahblah;first=1,second=two
bl.hbl-hbl_hbl4hbl4h;first=1,second=two,third=thr33
The best I've come up with so far is ([A-Za-z1-9_\-\.]+);(((.+?)(?:,|$))+)
which is obviously far from correct. I am not good at writing regexps with lookaheads, lookbehinds, and other relatively advanced stuff in regex but I hope that a regex solution exists for this problem.
If regex engine matters, I am using the Perl-compatible regex engine in PHP 8.1