Contact

Text Β· cross-software comparison

Replace every numeric run

Replace digits with ID in a text string: compare LibreOffice REGEX global flag and Calligra REGEXPRE behaviour.

Task

In β€œOrder 0042”, replace every run of digits with β€œID”.

Expected output

Order ID

Compatibility trap: A replacement function can default to only the first match; global replacement semantics must be explicit.

One shared five-row test dataset

The same source rows make results easier to compare. Use the CSV in any supported spreadsheet application; the ODS workbook also includes LibreOffice formula tests.

Shared formula comparison fixture (columns A through F)
Region (A)Status (B)Amount (C)SKU (D)Label (E)Units (F)
NorthOpen125SKU-101Alpha2
SouthClosed80SKU-102Beta1
NorthOpen75SKU-103Gamma3
NorthClosed50SKU-104Delta4
SouthOpen200SKU-105Epsilon1

Formula syntax and feature differences

β€œDocumented” rows cite official product help, but were not run in the destination software. A formula shown here is a migration candidate, not a guarantee of identical behaviour or file interoperability.

Formulas can be selected and copied manually. Copy buttons become available when JavaScript is ready.

LibreOffice Calc

Native tested

Version: LibreOffice REGEX added in 6.2.

Arguments: REGEX(text;pattern;replacement;flags)

=REGEX("Order 0042";"[0-9]+";"ID";"g")

The g flag replaces all matches. Omit it for extraction or non-global behaviour.

Official documentation β†—

Apache OpenOffice Calc

Alternative

Arguments: SUBSTITUTE for known literal tokens

=SUBSTITUTE("Order 0042";"0042";"ID")

A fixed literal replacement is not a substitute for an arbitrary regex pattern.

Official documentation β†—

Calligra Sheets

Documented

Arguments: REGEXPRE(text;regexp;replacement)

=REGEXPRE("Order 0042";"[0-9]+";"ID")

KDE handbook says REGEXPRE replaces all matching substrings; do not substitute extraction-only REGEXP.

Official documentation β†—

ONLYOFFICE Spreadsheet Editor

Documented

Version: Added in 9.3 (2026).

Arguments: REGEXREPLACE (new in ONLYOFFICE 9.3; argument syntax to confirm)

ONLYOFFICE 9.3 officially added REGEXREPLACE. The call signature needs a separate runtime/documentation check.

Official documentation β†—

Zoho Sheet

Documented

Arguments: REGEXREPLACE(text;regex;replacement;[occurrence];[case_sensitivity])

=REGEXREPLACE("Order 0042";"[0-9]+";"ID")

Default occurrence 0 replaces all matches, unlike non-global modes in other regex engines.

Official documentation β†—

Microsoft Excel

Documented

Version: Microsoft 365 for Windows and Mac; not Excel 2021/2024 by default.

Arguments: REGEXREPLACE(text, pattern, replacement, [occurrence], [case_sensitivity])

=REGEXREPLACE("Order 0042","[0-9]+","ID")

Microsoft uses PCRE2 regular expressions; 0 replaces every match.

Important: Vendor help checked; example not executed in this program.

Official documentation β†—

Google Sheets

Documented

Version: Current Google Sheets.

Arguments: REGEXREPLACE(text, regular_expression, replacement)

=REGEXREPLACE("Order 0042","[0-9]+","ID")

Google uses RE2 and replaces matching text; compare flags with Excel carefully.

Important: Vendor help checked; example not executed in this program.

Official documentation β†—

WPS Spreadsheet

Not researched

Version: Specific version and deployment must be established

This product is listed for future comparison research; no verified formula or feature parity is asserted.

Alternative: Read the vendor help and test against the shared fixture before migrating.

Important: Not tested or verified for this function.

Collabora Office Calc

Not researched

Version: Specific version and deployment must be established

This product is listed for future comparison research; no verified formula or feature parity is asserted.

Alternative: Read the vendor help and test against the shared fixture before migrating.

Important: Not tested or verified for this function.

What changes when you migrate?

Include two separate numeric groups (β€œItem 15 in bin 42”) in migration tests: that exposes accidental first-match-only replacements.

Do not confuse Calligra REGEXP (extraction) with REGEXPRE (replacement); the names differ from LibreOffice.

Fixed-token SUBSTITUTE can be the safest portable option when the source token is always known and literal.

Actual LibreOffice calculation evidence

The historical results report dated October 10, 2026 records calculation-engine checks in LibreOffice Calc 25.2.3.2 using headless UNO, not a GUI or workbook round-trip check. The published manifest provides the exact input formula, checked result, and whether the test validates a scalar result rather than array spill layout.

Test ID: regex-replace. See calculation results (JSON).

One match or every match?

The fixture’s result Order ID can be obtained by replacing one digit group. That alone is insufficient to prove global replacement. The follow-up test should use Item 15 in bin 42, with expected result Item ID in bin ID.

LibreOffice’s REGEX() uses an explicit g flag to replace all matches. KDE Calligra’s REGEXPRE() documentation says that all matches are replaced. Zoho Sheet’s REGEXREPLACE() has an occurrence selector, with its default applying to all matches. This is a real argument and default difference, not simply punctuation.

ONLYOFFICE 9.3 added regex replacement. The patch does not claim that a sample formula was executed there. If that capability is a requirement, check the installed editor version and verify the function signature before publishing a cross-platform template.

When not to use regex

If the text token is always the known literal 0042, a simple SUBSTITUTE is easier to read and more portable. Regex is valuable when the text follows a variable pattern, but it increases the burden on data maintainers.

Evidence standard: Only LibreOffice rows labelled β€œNative tested” were run as executable fixtures. Other entries reflect vendor help or a separately labelled workaround. Dates and versions are shown when known. Last editorial research: 2026-10-11.

← Back to all comparisons