Skip to content

Instantly share code, notes, and snippets.

@jershmagersh
Last active December 23, 2015 10:09
Show Gist options
  • Save jershmagersh/6619272 to your computer and use it in GitHub Desktop.
Save jershmagersh/6619272 to your computer and use it in GitHub Desktop.
void DB::search(string &currLine)
{
smatch result;
ofstream outfile;
regex_search(currLine, result, *globalMatchBlock);
for(int i = 0; i < result.size(); i++){
if(result[i].length() > 2 && i != 0) {
outfile << "Match: " << (*rulesVec)[i-1].alert << endl; //Access alert in vector at that index, since that's the one that matched...
outfile << "From: " << result[0] << endl << endl;
outfile.flush();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment