class OptionValueRegex : public OptionValue {
public:
OptionValueRegex(const char *value = nullptr)
- : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)) {}
+ : OptionValue(), m_regex(llvm::StringRef::withNullAsEmpty(value)),
+ m_default_regex_str(llvm::StringRef::withNullAsEmpty(value).str()) {}
~OptionValueRegex() override = default;
VarSetOperationType = eVarSetOperationAssign) = delete;
bool Clear() override {
- m_regex = RegularExpression();
+ m_regex = RegularExpression(m_default_regex_str);
m_value_was_set = false;
return true;
}
protected:
RegularExpression m_regex;
+ std::string m_default_regex_str;
};
} // namespace lldb_private