Dim dlg As new OpenFileDialog dlg.Filter = "文本文件|*.txt" If dlg.ShowDialog = DialogResult.OK Then Dim strs As String = FileSys.ReadAllText(dlg.FileName, encoding.default) Dim mc = System.Text.RegularExpressions.Regex.Matches(strs,"(?is)(?<=此邮件来自智通人才网).*?(?=编号)") If mc.count >= 1 Then msgbox(mc(0).value) End If End If