如果数据很大请选择X64
Imports System.Text.RegularExpressions
Imports System.IO
Module Module1
Public myemail As New List(Of String)
Sub Main()
Dim reader As New StreamReader("all2.txt")
Dim my1 As String = String.Empty
While reader.Peek > -1
my1 = reader.ReadLine
If isemail(my1.Split("|")(0)) Then'格式是 email | password
If my1.Split("@")(0).Length - 1 <= 64 Then'判断name是否大于64个字符
myemail.Add(my1)
End If
End If
End While
reader.Close()
Dim write As New StreamWriter("done.txt")
For Each temp As String In myemail
write.WriteLine(temp)
Next
write.Flush()
write.Close()
Console.WriteLine("done!")
Console.ReadKey()
End Sub
Public Function isemail(ByVal email As String)
Dim strexp As String = "^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"
Dim r As New Regex(strexp)
Dim m As Match = r.Match(email)
Return m.Success
End Function
End Module
Comments