[Libreoffice-bugs] [Bug 118505] New: When using regex and find.text different positions (begining or the end of string) are returned.

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jul 2 15:53:01 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=118505

            Bug ID: 118505
           Summary: When using regex and find.text different positions
                    (begining or the end of string) are returned.
           Product: LibreOffice
           Version: 6.0.5.1 rc
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: mkotl at ibb.waw.pl

Description:
Find returns the beginning or the end of string found when using regex.
The easiest way to explain this is an example:

The string  result   formula
123456789     5     =SZUKAJ.TEKST("3?5"; A1)
123456789     3     =SZUKAJ.TEKST("345"; B2)
123456790     3     =SZUKAJ.TEKST("3.5"; B3)
123456791     5     =SZUKAJ.TEKST("3*5"; B4)
123456792     3     =SZUKAJ.TEKST("3[0-9]5"; B5)
123456795     3     =SZUKAJ.TEKST("3[0-9]*5"; B6)
(Polish szukaj.text = find)

One can notice that when we use "?" or "*" we get the position of the last
character.
When "." or [0-9] or [0-9]* is used the position of the first character is
returned which, I suppose, is correct.



Steps to Reproduce:
1. Use find function with '.' and '?' locate some substring in string e.g "345"
(test "345", "3.5" and "3?5") in "123456789".
2. Compare the results (returned position)


Actual Results:
when searching "345" in "123456789" position 3 is returned (correct)
when searching "3?5" in "123456789" position 5 is returned (not correct)
when searching "3*5" in "123456789" position 5 is returned (not correct)
when searching "3[0-9]5" in "123456789" position 3 is returned (correct)

Expected Results:
I suppose that always the begining of found substring should be returned (3 in
the above example).


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Tested on 6.0.5.1(Linux), 6.0.5.2 (win), 6.0.2.1 (win). Always the same.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180702/96d56530/attachment.html>


More information about the Libreoffice-bugs mailing list