Created
March 5, 2021 10:30
-
-
Save xdanielsb/aa8da6de3ba26712c6a002601a3d1fa1 to your computer and use it in GitHub Desktop.
Revisions
-
xdanielsb created this gist
Mar 5, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ #include<bits/stdc++.h> using namespace std; /* * @author: xdanielsb * get timestamps log file */ int main(){ ifstream file("redh324-p.log"); string str; smatch m; regex regexp("[0-9]{2}/[a-zA-z]{3}/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2}"); set<string> aux; while (getline(file, str)){ regex_search(str, m, regexp); for (auto x : m) aux.insert(x); } for( string x: aux){ cout << x <<endl; } }