2014-10-13 14:12:33 +02:00
|
|
|
#include "regex.hh"
|
|
|
|
|
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2017-10-09 08:56:47 +02:00
|
|
|
Regex::Regex(StringView re, RegexCompileFlags flags, MatchDirection direction)
|
|
|
|
: m_impl{new CompiledRegex{compile_regex(re, flags, direction)}},
|
2017-10-09 08:37:43 +02:00
|
|
|
m_str{re.str()}
|
2017-11-01 07:08:03 +01:00
|
|
|
{}
|
2016-05-10 10:12:30 +02:00
|
|
|
|
2014-10-13 14:12:33 +02:00
|
|
|
String option_to_string(const Regex& re)
|
|
|
|
{
|
2016-02-05 00:52:06 +01:00
|
|
|
return re.str();
|
2014-10-13 14:12:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void option_from_string(StringView str, Regex& re)
|
|
|
|
{
|
2015-07-25 12:15:03 +02:00
|
|
|
re = Regex{str};
|
2014-10-13 14:12:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|