At the input line of the form
asdfsadfs=dfasfsdfd; sdfasdf dfsdff=sdfsdf; dsfasdfsdf=sdfsdf
How to extract what begins with the signs "=" and ";" either "=" and the end of the line (that is, from the first occurrence of the character "=" to the first occurrence of the character ";" or to the end of the line if there is no ";")?
string x = Regex.Match(z, @"\=(.*?)[;$]").Groups[1].Value;
The "$" character inside a character class is not perceived as the end of a line.
=(.*?)(;|$)
, But this is not the optimal solution. - Specter