Bug 127796 - Malfunction of the "Find" operation with regular expressions.
Summary: Malfunction of the "Find" operation with regular expressions.
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.7.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 15:11 UTC by Jerzy Moruś
Modified: 2020-04-24 17:58 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerzy Moruś 2019-09-26 15:11:24 UTC
Description:
In my opinion, string search using regular expressions does not work correctly when searching for strings of any characters contained in two bounding characters.
Let BOS be the initial delimiter of the search string and EOS be the final delimiter.
Regular expression in the form of "BOS.*EOS" finds a string containing the last instance of EOS. In this situation, you cannot correctly recognize the strings sought in such a structure:
"string1 BOS string2 EOS string3 BOS string4 EOS string5"
In the example above, there are two strings matching the match condition, but the search operation finds only one, terminated with a second EOS tag.
This causes problems when searching inside paragraphs multiple instances of strings enclosed in parentheses or enclosed in quotation marks.
In addition, the new REGEX function in Calc cannot be properly used to find, for example, the fourth occurrence of <tr>. * </tr> sequence obtained from the WEBSEVICE function

Steps to Reproduce:
nothing

Actual Results:
nothing

Expected Results:
nothing


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Buovjaga 2020-04-24 17:58:32 UTC
Use a non-greedy regex and it works as you would expect:
BOS.*?EOS