Bug 161271 - enhancement: support new Excel regex spreadsheet functions, REGEXTEST, REGEXEXTRACT, REGEXREPLACE
Summary: enhancement: support new Excel regex spreadsheet functions, REGEXTEST, REGEXE...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Missed-Excel-Functions
  Show dependency treegraph
 
Reported: 2024-05-25 07:28 UTC by johnks
Modified: 2024-05-31 13:08 UTC (History)
4 users (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 johnks 2024-05-25 07:28:06 UTC
Description:
https://insider.microsoft365.com/en-us/blog/new-regular-expression-regex-functions-in-excel

excel is introducing these 3 regex formulae  with more regex support in xlookup and xmatch but lets focus on these 3 for now


    REGEXTEST: Checks if any part of supplied text matches a regex pattern.
    REGEXEXTRACT: Extracts one or more parts of supplied text that match a regex pattern.
    REGEXREPLACE: Searches for a regex pattern within supplied text and replaces it with different text.


Steps to Reproduce:
support new excel formulae regarding regex

Actual Results:
formula is missing

Expected Results:
formula should work in calc as it works in excel 


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 1 m_a_riosv 2024-05-25 10:47:27 UTC
As always, MS collaborating with the world.

REGEX is available on LibreOffice since 2018 (tdf#113977)

https://help.libreoffice.org/latest/en-US/text/scalc/01/func_regex.html?DbPAR=CALC#bm_id831542233029549
Comment 2 johnks 2024-05-25 11:13:22 UTC
(In reply to m_a_riosv from comment #1)
> As always, MS collaborating with the world.
> 
> REGEX is available on LibreOffice since 2018 (tdf#113977)
> 
> https://help.libreoffice.org/latest/en-US/text/scalc/01/func_regex.
> html?DbPAR=CALC#bm_id831542233029549

i am specifically asking to support windows =regextest and other 2 formulae. 

i know LO has has regex for ages but this isn't a drop in replacement for the new excel formulae or is it?
Comment 3 Eike Rathke 2024-05-27 10:14:25 UTC
Should be fairly straight forward to implement these functions for interoperability, as each of them covers a limited subset of what REGEX() already does. Care should be taken to not duplicate the implementation four times but factor out the common part(s).

However, results may have to be taken with a grain of salt, if Excel uses a regex engine with different capabilities than ICU regex they may differ, which generally isn't a problem with commonly used regex patterns and features but more sophisticated details.
Comment 4 Heiko Tietze 2024-05-27 12:23:02 UTC
+1 for interoperability

(In reply to Eike Rathke from comment #3)
> Should be fairly straight forward to implement...
Easyhackable?
Comment 5 Eike Rathke 2024-05-31 13:08:45 UTC
Not really. For new functions too many places need to be touched to get it right.