#include <ored/utilities/wildcard.hpp>
Definition at line 36 of file wildcard.hpp.
◆ Wildcard()
Wildcard |
( |
const std::string & |
pattern, |
|
|
const bool |
usePrefixes = true , |
|
|
const bool |
aggressivePrefixes = false |
|
) |
| |
|
explicit |
all characters in s keep their original meaning except * which is a placeholder for zero or more characters not equal to newline
Definition at line 39 of file wildcard.cpp.
41
43
45 return;
46
48
51 } else {
53 static std::vector<std::string> specialChars = {"\\", ".", "+", "?", "^", "$", "(",
54 ")", "[", "]", "{", "}", "|"};
55 for (auto const& c : specialChars) {
57 }
59 }
60}
boost::optional< std::string > prefixString_
const std::string & pattern() const
boost::optional< std::string > regexString_
◆ hasWildcard()
bool hasWildcard |
( |
| ) |
const |
◆ wildcardPos()
std::size_t wildcardPos |
( |
| ) |
const |
◆ isPrefix()
◆ matches()
bool matches |
( |
const std::string & |
s | ) |
const |
Definition at line 68 of file wildcard.cpp.
68 {
70 return s.substr(0, (*prefixString_).size()) == (*prefixString_);
74 return std::regex_match(s, *
regex_);
75 } else {
77 }
78}
QuantLib::ext::shared_ptr< std::regex > regex_
◆ pattern()
const std::string & pattern |
( |
| ) |
const |
◆ regex()
const std::string & regex |
( |
| ) |
const |
◆ prefix()
const std::string & prefix |
( |
| ) |
const |
◆ pattern_
◆ usePrefixes_
◆ aggressivePrefixes_
◆ hasWildCard_
bool hasWildCard_ = false |
|
private |
◆ wildCardPos_
◆ regexString_
boost::optional<std::string> regexString_ |
|
private |
◆ prefixString_
boost::optional<std::string> prefixString_ |
|
private |
◆ regex_
QuantLib::ext::shared_ptr<std::regex> regex_ |
|
mutableprivate |