Last active
December 23, 2015 10:09
-
-
Save jershmagersh/6619260 to your computer and use it in GitHub Desktop.
Search regex construction
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 characters
if(this->rules->size() > 0) { | |
string searchBlock = ""; | |
for(rulesIter = this->rules->begin(); rulesIter != this->rules->end(); rulesIter++) { | |
if(rulesIter == this->rules->begin()) //Construct a big fat regex from all of the rules. | |
searchBlock += ".*(" + rulesIter->first + ").*"; | |
else searchBlock += "|.*(" + rulesIter->first + ").*"; | |
} | |
this->globalMatchBlock = new regex(searchBlock); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment