[Libreoffice-bugs] [Bug 118505] 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
Tue Jul 3 13:06:03 UTC 2018


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

--- Comment #4 from Maciej KotliƄski <mkotl at ibb.waw.pl> ---
Actually I've got this problem when striping the last digit (and possibly a
character) from the name names of samples from some analyses.
I've got such names as in first column and would like to strip last digit and
possibly letter. I was surprised to get different results for "KHe3r" and
"KHe3" when using "[0-9]?$". One can deal with the problem with
"[0-9][a-z]{0,1}$" which work as I expected.

 =SZUKAJ.TEKST(REGEX; AX)

         "[0-9]?$"  stripped text*  "[0-9][a-z]{0,1}$"  stripped text*
K-7dpi3      7          K-7dpi             7             K-7dpi
KHe1         4          KHe                4             KHe
KHe2s        6          KHe2s              4             KHe
KHe3         4          KHe                4             KHe
KHe3r        6          KHe3r              4             KHe
KL101a       7          KL101a             5             KL10
KL102        5          KL10               5             KL10
KL103        5          KL10               5             KL10
KL10-3dpi1  10          KL10-3dpi         10             KL10-3dpi
KL10-3dpi2  10          KL10-3dpi         10             KL10-3dpi
MM-10dpi1    9          MM-10dpi           9             MM-10dpi

*stripped text returned by =FRAGMENT.TEKSTU(A1; 1; [result from the coulumn
with position]-1)

Thank you for clarifying the problem. I describe the solution which works for
me. Maybe it will be helpful for somebody.

-- 
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/20180703/f195414d/attachment-0001.html>


More information about the Libreoffice-bugs mailing list