Building regex by vector of others
- Dominant language
- C++
- Stars
- 19
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
Hello.
I need to find which regex of N my string matches.
It's easy to implement if I have them compile time:
```cpp
sregex re = (s1 = re1)|(s2 = re2)|(s3=re3);
...
std::set foo(const std::string& str) {
std::set result;
smatch match;
if(regex_match(str, match, re)) {
for(int i = 0; i<3; ++i)
if(match[i+1]) result.insert(i);
}
return result;
}
```
But I have a vector:
```cpp
std::set foo(const std::string& str, const std::vector& reVector) {
sregex re;
int index = 1;
for(auto&& item : reVector) {
re |= (mark_tag(index++) = item); // (1)
}
std::set result;
smatch match;
if(regex_match(str, match, re)) {
for(int i = 0; i
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.