mirror of
https://github.com/g4klx/DAPNETGateway.git
synced 2026-08-26 12:32:45 -04:00
Further work on REGEX
This commit is contained in:
parent
984bfb00bb
commit
9a0b79b301
1 changed files with 2 additions and 1 deletions
|
|
@ -303,11 +303,12 @@ int CDAPNETGateway::run()
|
|||
if (!whiteList.empty())
|
||||
found = std::find(whiteList.begin(), whiteList.end(), message->m_ric) != whiteList.end();
|
||||
m_regex.push_back(std::regex("^E.*"));
|
||||
//If the regex matches the message body, don't send the message
|
||||
//If we have a list of blacklist REGEXes, use them
|
||||
if (!m_regex.empty()) {
|
||||
std::string messageBody(reinterpret_cast<char*>(message->m_message));
|
||||
for (std::regex regex : m_regex) {
|
||||
bool ret = std::regex_match(messageBody,regex);
|
||||
//If the regex matches the message body, don't send the message
|
||||
if (ret)
|
||||
found = false;
|
||||
LogDebug("blacklist Regex match, not queueing message");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue