Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
split_by_regex.cc
Go to the documentation of this file.
1
#include <algorithm>
2
#include <regex>
3
#include <string>
4
#include <vector>
5
6
namespace
cet
{
7
std::vector<std::string>
8
split_by_regex
(
std::string
const
&
str
, std::regex
const
& reDelimSet)
9
{
10
std::vector<std::string> tokens;
11
std::copy
(
12
std::sregex_token_iterator(str.begin(), str.end(), reDelimSet, -1),
13
std::sregex_token_iterator{},
14
std::back_inserter(tokens));
15
return
tokens;
16
}
17
18
std::vector<std::string>
19
split_by_regex
(
std::string
const
&
str
,
std::string
const
& delimSet)
20
{
21
std::regex
const
tmpRegex{delimSet};
22
return
split_by_regex
(str, tmpRegex);
23
}
24
}
string
std::string string
Definition:
nybbler.cc:12
cet::split_by_regex
std::vector< std::string > split_by_regex(std::string const &str, std::regex const &reDelimSet)
Definition:
split_by_regex.cc:8
cet
Definition:
PluginSymbolResolvers.h:8
copy
T copy(T const &v)
Definition:
RangeForWrapper_test.cc:98
str
static QCString str
Definition:
fortrancode.cpp:27098
Generated by
1.8.11