Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CalibTracker/SiStripCommon/interface/Book.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "TH2D.h"
#include "TProfile.h"
#include "TH3D.h"
#include <boost/regex.hpp>
#include <regex>
#include <boost/iterator/filter_iterator.hpp>

class Book {
Expand All @@ -25,10 +25,10 @@ class Book {

struct match_name {
match_name(string_t re) : expression(re) {}
bool operator()(const book_t::const_iterator::value_type& p) { return regex_match(p.first, expression); }
bool operator()(const book_t::const_iterator::value_type& p) { return std::regex_match(p.first, expression); }

private:
boost::regex expression;
std::regex expression;
};

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sstream>
#include <fstream>
#include <vector>
#include <boost/regex.hpp>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sstream>
#include <fstream>
#include <vector>
#include <boost/regex.hpp>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down
9 changes: 4 additions & 5 deletions CommonTools/Utils/src/TFileDirectory.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#include <ostream>
#include <iostream>
#include <regex>

#include "CommonTools/Utils/interface/TFileDirectory.h"

#include "boost/regex.hpp"

using namespace std;

TDirectory *TFileDirectory::getBareDirectory(const string &subdir) const { return _cd(subdir, false); }
Expand Down Expand Up @@ -75,11 +74,11 @@ TDirectory *TFileDirectory::_mkdir(TDirectory *dirPtr, const string &subdirName,
}
// if we're here, then this directory doesn't exist. Is this
// directory a subdirectory?
const boost::regex subdirRE("(.+?)/([^/]+)");
boost::smatch matches;
const std::regex subdirRE("(.+?)/([^/]+)");
std::smatch matches;
TDirectory *parentDir = nullptr;
string useName = subdirName;
if (boost::regex_match(subdirName, matches, subdirRE)) {
if (std::regex_match(subdirName, matches, subdirRE)) {
parentDir = _mkdir(dirPtr, matches[1], description);
useName = matches[2];
} else {
Expand Down
3 changes: 0 additions & 3 deletions DQM/HLTEvF/plugins/PSMonitorClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#include <string>
#include <cstring>

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

// Root headers
#include <TH1F.h>

Expand Down
3 changes: 0 additions & 3 deletions DQM/HLTEvF/plugins/TriggerRatesMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#include <fmt/printf.h>

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

// Root headers
#include <TH1F.h>

Expand Down
11 changes: 4 additions & 7 deletions DQMOffline/Trigger/plugins/HLTMuonRefMethod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <cmath>
#include <climits>
#include <boost/tokenizer.hpp>
#include <boost/regex.hpp>
#include <regex>

#include <TH1.h>
#include <TEfficiency.h>
Expand Down Expand Up @@ -55,9 +55,7 @@ class HLTMuonRefMethod : public DQMEDHarvester {
};

HLTMuonRefMethod::HLTMuonRefMethod(const edm::ParameterSet& pset) {
using VPSet = std::vector<edm::ParameterSet>;
using vstring = std::vector<std::string>;
using elsc = boost::escaped_list_separator<char>;

subDirs_ = pset.getUntrackedParameter<vstring>("subDirs");
hltTriggers_ = pset.getUntrackedParameter<vstring>("hltTriggers");
Expand All @@ -69,9 +67,8 @@ HLTMuonRefMethod::HLTMuonRefMethod(const edm::ParameterSet& pset) {
void HLTMuonRefMethod::beginJob() {}

void HLTMuonRefMethod::dqmEndJob(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
using vstring = std::vector<std::string>;
boost::regex metacharacters{"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]"};
boost::smatch what;
std::regex metacharacters{"[\\^\\$\\.\\*\\+\\?\\|\\(\\)\\{\\}\\[\\]]"};
std::smatch what;

// theDQM = 0;
// theDQM = Service<DQMStore>().operator->();
Expand All @@ -85,7 +82,7 @@ void HLTMuonRefMethod::dqmEndJob(DQMStore::IBooker& ibooker, DQMStore::IGetter&
if (subDir[subDir.size() - 1] == '/')
subDir.erase(subDir.size() - 1);

if (boost::regex_search(subDir, what, metacharacters)) {
if (std::regex_search(subDir, what, metacharacters)) {
const string::size_type shiftPos = subDir.rfind('/');
const string searchPath = subDir.substr(0, shiftPos);
const string pattern = subDir.substr(shiftPos + 1, subDir.length());
Expand Down
8 changes: 4 additions & 4 deletions DQMServices/StreamerIO/plugins/DQMFileIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/range.hpp>
#include <boost/regex.hpp>
#include <regex>
#include <fmt/printf.h>

#include "FWCore/MessageLogger/interface/MessageLogger.h"
Expand Down Expand Up @@ -233,7 +233,7 @@ namespace dqmservices {

directory_iterator dend;
for (directory_iterator di(runPath); di != dend; ++di) {
const boost::regex fn_re("run(\\d+)_ls(\\d+)_([a-zA-Z0-9]+)(_.*)?\\.jsn");
const std::regex fn_re("run(\\d+)_ls(\\d+)_([a-zA-Z0-9]+)(_.*)?\\.jsn");

const std::string filename = di->path().filename().string();
const std::string fn = di->path().string();
Expand All @@ -242,8 +242,8 @@ namespace dqmservices {
continue;
}

boost::smatch result;
if (boost::regex_match(filename, result, fn_re)) {
std::smatch result;
if (std::regex_match(filename, result, fn_re)) {
unsigned int run = std::stoi(result[1]);
unsigned int lumi = std::stoi(result[2]);
std::string label = result[3];
Expand Down
13 changes: 5 additions & 8 deletions DQMServices/StreamerIO/plugins/RamdiskMonitor.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <filesystem>
#include <map>
#include <vector>
#include <regex>
#include <sys/stat.h>

#include <fmt/printf.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/range.hpp>
#include <boost/regex.hpp>

#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
Expand Down Expand Up @@ -178,7 +178,7 @@ namespace dqm {

directory_iterator dend;
for (directory_iterator di(runPath_); di != dend; ++di) {
const boost::regex fn_re("run(\\d+)_ls(\\d+)_([a-zA-Z0-9]+)(_.*)?\\.jsn");
const std::regex fn_re("run(\\d+)_ls(\\d+)_([a-zA-Z0-9]+)(_.*)?\\.jsn");

const std::string filename = di->path().filename().string();
const std::string fn = di->path().string();
Expand All @@ -187,8 +187,8 @@ namespace dqm {
continue;
}

boost::smatch result;
if (boost::regex_match(filename, result, fn_re)) {
std::smatch result;
if (std::regex_match(filename, result, fn_re)) {
unsigned int run = std::stoi(result[1]);
unsigned int lumi = std::stoi(result[2]);
std::string label = result[3];
Expand All @@ -210,10 +210,7 @@ namespace dqm {
// it's likely we have read it too soon
filesSeen_.erase(filename);

std::string msg("Found, tried to load the json, but failed (");
msg += e.what();
msg += "): ";
edm::LogWarning("RamdiskMonitor") << msg;
edm::LogWarning("RamdiskMonitor") << "Found, tried to load the json, but failed (" << e.what() << "): ";
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions DQMServices/StreamerIO/plugins/TriggerSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include <iostream>
#include <boost/regex.hpp>
#include <regex>
#include <algorithm>
#include <cassert>

Expand Down Expand Up @@ -72,12 +72,11 @@ namespace dqmservices {

// replace all possible alternate operators (.AND. and .OR.)
{
using namespace boost;
std::string temp;
temp = regex_replace(expression, regex(".AND."), "&&");
expression_ = regex_replace(temp, regex(".and."), "&&");
temp = regex_replace(expression_, regex(".OR."), "||");
expression_ = regex_replace(temp, regex(".or."), "||");
temp = std::regex_replace(expression, std::regex(".AND."), "&&");
expression_ = std::regex_replace(temp, std::regex(".and."), "&&");
temp = std::regex_replace(expression_, std::regex(".OR."), "||");
expression_ = std::regex_replace(temp, std::regex(".or."), "||");
}

// build decision tree
Expand Down
6 changes: 3 additions & 3 deletions DataFormats/PatCandidates/interface/EventHypothesis.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include "DataFormats/Candidate/interface/CandidateFwd.h"
#include "DataFormats/Candidate/interface/Candidate.h"
#include <boost/regex.hpp>

#include <regex>
#include <typeinfo>
#include <iostream>
#include <type_traits>
Expand Down Expand Up @@ -131,11 +131,11 @@ namespace pat {
public:
explicit RoleRegexpFilter(const std::string &roleRegexp) : re_(roleRegexp) {}
bool operator()(const CandRefType &cand, const std::string &role) const override {
return boost::regex_match(role, re_);
return std::regex_match(role, re_);
}

private:
boost::regex re_;
std::regex re_;
};
} // namespace eventhypothesis

Expand Down
4 changes: 1 addition & 3 deletions EventFilter/L1TRawToDigi/src/MP7PacketReader.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include "EventFilter/L1TRawToDigi/interface/MP7PacketReader.h"

#include <iostream>

using std::cout;
using std::endl;
#include <set>

MP7PacketReader::MP7PacketReader(const std::string& path, uint32_t striphdr, uint32_t stripftr, uint32_t ikey)
: reader_(path), header_(striphdr), footer_(stripftr), ikey_(ikey) {
Expand Down
1 change: 0 additions & 1 deletion Fireworks/Core/src/CmsShowNavigator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// system include files
#include <functional>
#include "boost/regex.hpp"
#include "TROOT.h"
#include "TTree.h"
#include "TFile.h"
Expand Down
18 changes: 9 additions & 9 deletions Fireworks/Core/src/FWFileEntry.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <boost/regex.hpp>
#include <regex>

#include "TFile.h"
#include "TEveTreeTools.h"
Expand Down Expand Up @@ -346,17 +346,17 @@ void FWFileEntry::runFilter(Filter* filter, const FWEventItemsManager* eiMng) {
item->setEvent(nullptr);
}

boost::regex re(std::string("\\$") + (*i)->name());
std::regex re(std::string("\\$") + (*i)->name());

if (boost::regex_search(interpretedSelection, re)) {
if (std::regex_search(interpretedSelection, re)) {
const edm::TypeWithDict elementType(const_cast<TClass*>(item->type()));
const edm::TypeWithDict wrapperType = edm::TypeWithDict::byName(edm::wrappedClassName(elementType.name()));
std::string fullBranchName = m_event->getBranchNameFor(wrapperType.typeInfo(),
item->moduleLabel().c_str(),
item->productInstanceLabel().c_str(),
item->processName().c_str());

interpretedSelection = boost::regex_replace(interpretedSelection, re, fullBranchName + ".obj");
interpretedSelection = std::regex_replace(interpretedSelection, re, fullBranchName + ".obj");

branch_names.push_back(fullBranchName);

Expand Down Expand Up @@ -456,8 +456,8 @@ void FWFileEntry::runFilter(Filter* filter, const FWEventItemsManager* eiMng) {
bool FWFileEntry::filterEventsWithCustomParser(Filter* filterEntry) {
std::string selection(filterEntry->m_selector->m_expression);

boost::regex re_spaces("\\s+");
selection = boost::regex_replace(selection, re_spaces, "");
std::regex re_spaces("\\s+");
selection = std::regex_replace(selection, re_spaces, "");
if (selection.find("&&") != std::string::npos && selection.find("||") != std::string::npos) {
// Combination of && and || operators not supported.
return false;
Expand All @@ -483,10 +483,10 @@ bool FWFileEntry::filterEventsWithCustomParser(Filter* filterEntry) {
if (selection.find("||") != std::string::npos)
junction_mode = false; // OR

boost::regex re("\\&\\&|\\|\\|");
std::regex re("\\&\\&|\\|\\|");

boost::sregex_token_iterator i(selection.begin(), selection.end(), re, -1);
boost::sregex_token_iterator j;
std::sregex_token_iterator i(selection.begin(), selection.end(), re, -1);
std::sregex_token_iterator j;

// filters and how they enter in the logical expression
std::vector<std::pair<unsigned int, bool>> filters;
Expand Down
1 change: 0 additions & 1 deletion Fireworks/Core/src/FWGeometryTableViewBase.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <iostream>

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

#include "Fireworks/Core/interface/FWGeometryTableViewBase.h"
#include "Fireworks/Core/interface/FWGeoTopNode.h"
Expand Down
6 changes: 3 additions & 3 deletions Fireworks/Core/src/FWHLTTriggerTableView.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Original Author:
// Created: Tue Jan 25 16:02:03 CET 2011
//
#include <boost/regex.hpp>
#include <regex>

#include "Fireworks/Core/interface/FWHLTTriggerTableView.h"
#include "Fireworks/Core/interface/fwLog.h"
Expand Down Expand Up @@ -45,9 +45,9 @@ void FWHLTTriggerTableView::fillTable(fwlite::Event* event) {
m_tableManager->dataChanged();
return;
}
boost::regex filter(m_regex.value());
std::regex filter(m_regex.value());
for (unsigned int i = 0; i < triggerNames->size(); ++i) {
if (!boost::regex_search(triggerNames->triggerName(i), filter))
if (!std::regex_search(triggerNames->triggerName(i), filter))
continue;
m_columns.at(0).values.push_back(triggerNames->triggerName(i));
m_columns.at(1).values.push_back(Form("%d", hTriggerResults->accept(i)));
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/src/FWHLTValidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// system include files
#include <algorithm>
#include <cstring>
#include <boost/regex.hpp>
#include <regex>

// user include files
#include "Fireworks/Core/interface/FWHLTValidator.h"
Expand All @@ -25,7 +25,7 @@ void FWHLTValidator::fillOptions(const char* iBegin,
std::vector<std::pair<std::shared_ptr<std::string>, std::string> >& oOptions) const {
oOptions.clear();
std::string part(iBegin, iEnd);
part = boost::regex_replace(part, boost::regex(".*?(\\&\\&|\\|\\||\\s)+"), "");
part = std::regex_replace(part, std::regex(".*?(\\&\\&|\\|\\||\\s)+"), "");

if (m_triggerNames.empty()) {
edm::Handle<edm::TriggerResults> hTriggerResults;
Expand Down
Loading