diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-10-11 19:24:01 +0800 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-11-01 14:05:14 +0800 |
| commit | 2b97e4e124abd675ccbeef80fff4722d9f7b0fe3 (patch) | |
| tree | d7b459dcbd33c02c465eeaeaea03f55214a57ab2 /src/regex_impl.cc | |
| parent | 3c999aba3758188c91143c3c16742faa168b06df (diff) | |
Regex: Fix handling of ^ and $ in backward matching mode
Diffstat (limited to 'src/regex_impl.cc')
| -rw-r--r-- | src/regex_impl.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/regex_impl.cc b/src/regex_impl.cc index bb1f3537..11d0429a 100644 --- a/src/regex_impl.cc +++ b/src/regex_impl.cc @@ -1193,6 +1193,12 @@ auto test_regex = UnitTest{[]{ } { + TestVM<MatchDirection::Backward> vm{R"($)"}; + kak_assert(vm.exec("foo\nbar\nbaz\nqux", RegexExecFlags::Search | RegexExecFlags::NotEndOfLine)); + kak_assert(StringView{vm.captures()[0]} == "\nqux"); + } + + { TestVM<> vm{R"(()*)"}; kak_assert(not vm.exec(" ")); } |
