From e6538bb38cd509111f0f595f46e7d1ff71bcc017 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sat, 2 Dec 2023 08:20:55 +1100 Subject: Bug [#2157]. Fix regular expression search for word begin \< and word end \>. --- src/RESearch.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/RESearch.h') diff --git a/src/RESearch.h b/src/RESearch.h index b7955dc79..e3a9c8110 100644 --- a/src/RESearch.h +++ b/src/RESearch.h @@ -24,6 +24,10 @@ public: void Clear(); const char *Compile(const char *pattern, Sci::Position length, bool caseSensitive, bool posix); int Execute(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp); + void SetLineRange(Sci::Position startPos, Sci::Position endPos) noexcept { + lineStartPos = startPos; + lineEndPos = endPos; + } static constexpr int MAXTAG = 10; static constexpr int NOTFOUND = -1; @@ -47,7 +51,9 @@ private: Sci::Position PMatch(const CharacterIndexer &ci, Sci::Position lp, Sci::Position endp, const char *ap); - Sci::Position bol; + // positions to match line start and line end + Sci::Position lineStartPos; + Sci::Position lineEndPos; char nfa[MAXNFA]; /* automaton */ int sta; int failure; -- cgit v1.2.3