Text · eight-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.

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 ↗

Gnumeric

Not researched

Replacement with an arbitrary regular expression was not verified from the published function index.

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 ↗

Apple Numbers

Not researched

REGEX.EXTRACT is documented; a corresponding replacement function was not confirmed here.

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 ↗

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

Formula tested in LibreOffice Calc 25.2.3.2. 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-10.

← Back to all comparisons