I want to parse a log file to retrieve the time
, type
and the message
. A log file is constructed like this:
[08:52:18] [ERROR] Ceci doit aparaitre
[08:52:18] [WARN] Bonjour
I'm currently doing it like this:
var result = Regex.Match(fileLogs, @"/\[(.+)\] \[(.+)\] (.+)/g");
Which is working fine on website like RegexStorm but not on my code. I don't really understand why.
I want to retrieve these element to create a new instance of Log
(which have just 3 attributes: time
, type
and message
)