[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 Eike Rathke changed: What|Removed |Added CC||maddes+docfoundation@maddes ||.net --- Comment #10 from Eike Rathke --- *** Bug 119488 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #9 from Eike Rathke--- (In reply to Winfried Donkers from comment #8) > And the IFERROR around that is not from me, but from Google Sheets too. As > if they don't trust other applications to handle unknown functions properly. That again may make sense, if the function isn't handled and results in error but the formula is compiled and interpreted otherwise, then the final result is still the result that was displayed in Google Sheets, here "ab", instead of an error result. It will of course never follow changed input. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #8 from Winfried Donkers--- (In reply to Eike Rathke from comment #7) > (In reply to Winfried Donkers from comment #6) > Horrible. Why don't they use a simple COM.GOOGLE.REGEXTRACT(...) instead > like ODFF suggests. Their construct is terrible, it embeds the entire > function call and parameters as string parameter into the > __xludf.dummyfunction(). And the IFERROR around that is not from me, but from Google Sheets too. As if they don't trust other applications to handle unknown functions properly. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #7 from Eike Rathke--- (In reply to Winfried Donkers from comment #6) > table:formula="of:=IFERROR(__xludf.dummyfunction(REGEXEXTRACT( A1, > a. ));ab)" Horrible. Why don't they use a simple COM.GOOGLE.REGEXTRACT(...) instead like ODFF suggests. Their construct is terrible, it embeds the entire function call and parameters as string parameter into the __xludf.dummyfunction(). REGEXMATCH and REGEXREPLACE would indeed make sense if we implemented any REGEX* function. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #6 from Winfried Donkers--- (In reply to Eike Rathke from comment #5) > (In reply to Dan Dascalescu from comment #4) > > Google Sheets supports REGEXEXTRACT. > Out of curiosity: when saving/exporting/downloading such a Google Sheet as > ODF, what is written as function name? with a common function looking like If this function is to be added, we should think about REGEXMATCH and REGEXREPLACE as well. (I'm interested in giving it a try, but only if there are more people saying the enhancement is wanted than just Dan Dascalescu and me.) -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 Eike Rathkechanged: What|Removed |Added CC||er...@redhat.com --- Comment #5 from Eike Rathke --- (In reply to Dan Dascalescu from comment #4) > Google Sheets supports REGEXEXTRACT. Out of curiosity: when saving/exporting/downloading such a Google Sheet as ODF, what is written as function name? -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #4 from Dan Dascalescu--- > At first sight it looks like a proper enhancement, one function that > with regex can extract the most wonderful parts out of a text string. That's what I was going for, thank you. > However I see some aspects that reduces its usefulness: > -regular expressions are not everybody's cup of tea. > This makes the function only useful to a very small group of users; A lot of users are familiar with wildcards, e.g. *.jpg. Many regexp tasks are solvable with just "foo.*bar". Anyway, by the logic "a function only serves some users therefore we shouldn't have it", none of the trigonometry functions should be in LibreCalc. For example, I've never used "arctangent" in my life. Or "BAHTTEXT". Wish I had numbers to show that far more Google Docs users use REGEXEXTRACT than BAHTTEXT. > -Calc has a setting (in preferences) in which wild cards or regular > expressions can be selected to be used in function arguments. This request is > limited to regular expressions only and thereby somewhat conflicts with the > wild card/regex setting; It "conflicts" only as much as the regex pattern for existing functions that use regexps, like SEARCH, conflicts. We can solve this problem the same way we solved the SEARCH problem. > -As the function is neither in ODFF nor in Excel, it will be incompatible > with other applications where LibreOffice strives for optimal > interoperability with other applications; Do we limit formatting because it's not compatible with CSV? 1. If a document author wants to provide backwards compatibility with applications that don't support a given function, they won't use that function. 2. What other applications exactly are we talking about? Only Excel has significant market share, because Google Sheets supports REGEXEXTRACT. 3. Innovation requires breaking compatibility. By providing a new function, we enable users to force the developers of their applications to step up and provide the same function. This very process is at work now as I'm adovating for supporting a function from Google Sheets... 4. ...which is reason #4 why we should implement that function - so Google Sheets that use it could be opened in LibreCalc. > -Calculations (including those on text strings) tend to look very complex > when the calculation goes further than just one simple calculation. This can > > be avoided by using more than one step I prefer not to litter my spreadsheet with cells that contain intermediate values. In my example with web service-based currency conversion (BTW a very common task that we don't have a good solution for - see bug 113974), the string "EUR:1.2,JPY:0.02,AUD:0.9,..." would require 2 intermediate cells per each currency. This would trade off formula complexity (usually invisible and forgotten about once you've figured out the formula) for the visible complexity of the intermediate cells (which, yes, could be hidden as well). Anyway, I'd love to have one clean function that can extract exactly what I need into the desired cell. > Creating new functions that combine other functions will only be useful if > there is a common need for them. I think Google Sheets shows there's a need for REGEXEXTRACT... > In programming it is the same: with some standard functions an almost > infinite amount of functionalities can be programmed; only functionality that > is widely used is put into a separate function. ... and so do all modern programming languages: "match" in JavaScript "search" in Python "matcher" in Java etc. > -A macro can provide the same functionality and be exactly suited to the > user's need. I would say a lot more users are comfortable using functions already provided by Calc/Excel/Sheets, than creating macros. > The enhancement request is clear, so I set the status to new. > @Dan : should you wish to do this yourself, LibreOffice has a mentor for > those new to developing for LibreOffice. I can help you with some code > pointers as well. Thank you. I hope to have time to tackle this on next year, though for now I've just been using a long formula, so my motivation has decreased somewhat. > IMHO A7 should be A1. Correct :) Which proves how brittle that sort of complex MID+SEARCH expression is. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 --- Comment #3 from Winfried Donkers--- (In reply to Dan Dascalescu from comment #0) > A3: =FIND(",", A7, SEARCH("(?<=JPY:)\d", A1)) // ← value ends right before > that IMHO A7 should be A1. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 Winfried Donkerschanged: What|Removed |Added Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Winfried Donkers --- (In reply to Xisco Faulí from comment #1) > @Winfried, what do you think ? There is no REGEXEXTRACT function defined in ODFF nor is it in Excel, so it's clearly an enhancement request. Personally I am both attracted by the request and reluctant to be enthusiastic. At first sight it looks like a proper enhancement, one function that with regex can extract the most wonderful parts out of a text string. However I see some aspects that reduces its usefulness: -regular expressions are not everybody's cup of tea. This makes the function only useful to a very small group of users; -Calc has a setting (in preferences) in which wild cards or regular expressions can be selected to be used in function arguments. This request is limited to regular expressions only and thereby somewhat conflicts with the wild card/regex setting; -As the function is neither in ODFF nor in Excel, it will be incompatible with other applications where LibreOffice strives for optimal interoperability with other applications; -Calculations (including those on text strings) tend to look very complex when the calculation goes further than just one simple calculation. This can be avoided by using more than one step (in the example in the description cells A2 and A3 can be used to make the formula in A4 much simpler: '=MID(A1;A2;A3-A2)', and the formula in A3 can be reduced to '=FIND(",", A1, A2)'). Creating new functions that combine other functions will only be useful if there is a common need for them. Otherwise there will be thousands of 'combination functions', each hardly used and very hard to to find the exact function a user has a need for. Right now there are already too much variations of functions (e.g. FIND and SEARCH) that confuse users and makes it hard to select the 'best' function. In programming it is the same: with some standard functions an almost infinite amount of functionalities can be programmed; only functionality that is widely used is put into a separate function. The complexity is the same too, a piece of code can be divided into easy to understand chunks or be written in a single line (that can only be deciphered by the programmer him/herself, provided (s)he remembers the clues). -A macro can provide the same functionality and be exactly suited to the user's need. Well, these are my thoughts, with 'my' meaning personal. The enhancement request is clear, so I set the status to new. @Dan : should you wish to do this yourself, LibreOffice has a mentor for those new to developing for LibreOffice. I can help you with some code pointers as well. The number of developers with both knowledge of the Calc code base and time available for enhancements like REGEXEXTRACT is very small, so it may take a long time before anyone picks this up. -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
[Libreoffice-bugs] [Bug 113977] Implement REGEXEXTRACT function
https://bugs.documentfoundation.org/show_bug.cgi?id=113977 Xisco Faulíchanged: What|Removed |Added CC||winfrieddonkers@libreoffice ||.org, ||xiscofa...@libreoffice.org Severity|normal |enhancement --- Comment #1 from Xisco Faulí --- @Winfried, what do you think ? -- You are receiving this mail because: You are the assignee for the bug.___ Libreoffice-bugs mailing list Libreoffice-bugs@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs