413f880e9e
No need to have two separate regexes to handle forward and backward matching, just passing RegexCompileFlags::Backward will add support for backward matching to the regex. For backward only regex, pass RegexCompileFlags::NoForward as well to disable generation of forward matching code.
22 lines
326 B
C++
22 lines
326 B
C++
#include "regex.hh"
|
|
|
|
namespace Kakoune
|
|
{
|
|
|
|
Regex::Regex(StringView re, RegexCompileFlags flags)
|
|
: m_impl{new CompiledRegex{compile_regex(re, flags)}},
|
|
m_str{re.str()}
|
|
{}
|
|
|
|
String option_to_string(const Regex& re)
|
|
{
|
|
return re.str();
|
|
}
|
|
|
|
void option_from_string(StringView str, Regex& re)
|
|
{
|
|
re = Regex{str};
|
|
}
|
|
|
|
}
|