diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-02 20:34:00 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-02 19:47:35 +0200 |
commit | 38f731ff67142a423aa6f46dc3e92d094f86ffb1 (patch) | |
tree | 92031cd3dde49eb37634de2b954b497301ab13be /include | |
parent | 0fb98963c46013209d39c03c3d61ef52ccc504e2 (diff) |
tdf#160478: fix Basic LIKE operator
1. The regex must match the whole input. Thus, the ^ and $ metacharacters
must be replaced with \A and \z, which only match beginning and end of
input, not any line start / end.
2. The * and ? metacharacters of LIKE must match newline character; thus,
search flags must include UREGEX_DOTALL. To avoid changing TextSearch
implementation, I use icu::RegexMatcher directly.
The direct use of icu::RegexMatcher also allowed to simplify the code by
calling icu::RegexMatcher::matches method. This may perform better than
general-purpose utl::TextSearch::SearchForward.
Change-Id: I75776498b36f236da294462362ed5b36ed8cdf68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165700
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions