正则表达式 - 选择以";"结尾的行

JHa*_*ey1 -1 c# regex

我有以下代码:

 if (Regex.IsMatch(fileLine, @"\s;$")) {
   listBox1.Items.Add(fileLine);
 }
Run Code Online (Sandbox Code Playgroud)

我需要匹配以";"结尾的整行.

And*_*ker 5

只需使用string.EndsWith:

if (fileLine.EndsWith(";"))
{
    listBox1.Items.Add(fileLine);
}
Run Code Online (Sandbox Code Playgroud)