Dim FileLines() As String = New String(){"test","I am a line","cool:","username: Hello123","Username: John","Hello there","USERnaMe: J.Johnsson","test again"}
Console.WriteLine("--- Input lines ---")
For Each InputLine As String In FileLines
Console.WriteLine(InputLine)
Next
Console.WriteLine(Environment.NewLine&"--- Found usernames ---")
Dim RgEx As New Regex("(?<=username:\s).+", RegexOptions.IgnoreCase)'Declare a new, case-insensitive Regex.
--- Input lines ---
test
I am a line
cool:
username: Hello123
Username: John
Hello there
USERnaMe: J.Johnsson
test again
--- Found usernames ---
Hello123
John
J.Johnsson