[Libreoffice-bugs] [Bug 140708] The REGEX function accepts all (ismx) but one (w) flags and only directly in the regular expression and does not allow all matches to be found at once

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Apr 13 17:33:26 UTC 2021


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

--- Comment #5 from Eike Rathke <erack at redhat.com> ---
(In reply to Igor from comment #4)
> 1) At least one flag ("i") duplicates the corresponding pattern option.
> E.g.
> With com.sun.star.i18n.TransliterationModules
>     oOptions.transliterateFlags = .IGNORE_CASE
> End With
How is that related to the REGEX() spreadsheet function?

> And how to use the following constants, I still do not understand:
>  Const Long REG_NOT_BEGINOFLINE = 0x00000800
>  Const Long REG_NOT_ENDOFLINE = 0x00001000
You don't. The REGEX() function does not use the UNO API's
css::util::SearchFlags.

> And if the analogy with Python is appropriate here, then the approach that I
> described is used there, only the sequence of flags ("ismxw") as a string is
> used.
> https://docs.python.org/3/library/re.html
That's not much different to how ICU handles it, is it? Prefixing the pattern
with (?ismxw) does exactly that, and is flexible as it can be switched on/off
at arbitrary positions. I see no benefit of flags parameter arguments that do
the same but only over all.


> 2) REGEX("barbaz";"a";;"g") returns not "aa", but an array of 2 matches {a;
> a},
Makes some sense.

> And if REGEX with the "g" (Global) flag replaces all occurrences, wouldn't
> it be logical to extract all of them also?
At least a possibility ;-)

-- 
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/20210413/ab51b53a/attachment.htm>


More information about the Libreoffice-bugs mailing list