Skip to content

Commit

Permalink
Merge pull request #18720 from Dr15Jones/changeToStdRegex
Browse files Browse the repository at this point in the history
Switched from boost::regex to std::regex
  • Loading branch information
cmsbuild committed May 13, 2017
2 parents a91de5a + cf89c00 commit 6e69de8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
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

0 comments on commit 6e69de8

Please sign in to comment.