https?:\/\/[^;]+);sb-key=(?P[^;]+);sb-exp=(?P\d+)/'; if (preg_match($pattern, $txtRecord, $matches)) { return new DnsRecord($matches['rpcEndpoint'], $matches['publicSigningKey'], (int)$matches['expirationTime']); } throw new InvalidArgumentException('Invalid TXT record format.'); } }