Hi,
I have a log file and I need to extract an email address from the log file. So far I have the code:
[CODE]
int atPos = logLine.indexOf(“@”);
if (atPos > -1) {
endPos = logLine.indexOf(” “, atPos);
System.out.println(logLine.substring(atPos, endPos));
}
logLine is a string which is a line of the log file.
This code ouputs
I really dont know how to look before the @ to get the username, so any help would be very welcome ?