Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched from boost::regex to std::regex #18720

Merged
merged 1 commit into from May 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions HLTrigger/HLTcore/src/HLTConfigProvider.cc
Expand Up @@ -19,7 +19,8 @@
#include "DataFormats/Provenance/interface/ProcessHistory.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include <boost/regex.hpp>
#include <regex>


// an empty dummy config data used when we fail to initialize
static const HLTConfigData* s_dummyHLTConfigData()
Expand Down Expand Up @@ -237,18 +238,18 @@ void HLTConfigProvider::clear()

const std::vector<std::string> HLTConfigProvider::matched(const std::vector<std::string>& inputs, const std::string& pattern) {
std::vector<std::string> matched;
const boost::regex regexp(edm::glob2reg(pattern));
const std::regex regexp(edm::glob2reg(pattern));
const unsigned int n(inputs.size());
for (unsigned int i=0; i<n; ++i) {
const std::string& input(inputs[i]);
if (boost::regex_match(input,regexp)) matched.push_back(input);
if (std::regex_match(input,regexp)) matched.push_back(input);
}
return matched;
}

const std::string HLTConfigProvider::removeVersion(const std::string& trigger) {
const boost::regex regexp("_v[0-9]+$");
return boost::regex_replace(trigger,regexp,"");
const std::regex regexp("_v[0-9]+$");
return std::regex_replace(trigger,regexp,"");
}

const std::vector<std::string> HLTConfigProvider::restoreVersion(const std::vector<std::string>& inputs, const std::string& trigger) {
Expand Down
6 changes: 3 additions & 3 deletions HLTrigger/HLTcore/src/TriggerExpressionL1uGTReader.cc
@@ -1,6 +1,6 @@
#include <iostream>
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#include <regex>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Utilities/interface/RegexMatch.h"
Expand Down Expand Up @@ -67,9 +67,9 @@ void L1uGTReader::init(const Data & data) {
} else {
// expand wildcards in the pattern
bool match = false;
boost::regex re(edm::glob2reg(m_pattern));
std::regex re(edm::glob2reg(m_pattern));
for (auto const & entry: triggerMap)
if (boost::regex_match(entry.first, re)) {
if (std::regex_match(entry.first, re)) {
match = true;
m_triggers.push_back( std::make_pair(entry.first, entry.second.getIndex()) );
}
Expand Down