Text · eight-software comparison

Extract digits using regex

Extract the digits 0042 from text without dropping leading zeros, contrasting LibreOffice REGEX, Calligra REGEXP and Apple Numbers REGEX.EXTRACT.

Task

From the literal text “Order 0042”, extract the first run of digits as TEXT.

Expected output

0042 (text, leading zeros preserved)

Compatibility trap: A number parsed as an integer becomes 42; extraction should remain text unless numerical calculation is intended.

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: REGEX available since LibreOffice 6.2.

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

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

With no replacement, returns the first matching substring; no match yields #N/A.

Official documentation ↗

Apache OpenOffice Calc

Alternative

Arguments: RIGHT for fixed-width identifiers

=RIGHT("Order 0042";4)

The official Calc regular-expression documentation concerns matching/search functions, not a native REGEX extraction function. Fixed-width RIGHT works for this known input only.

Alternative: Not safe for varying identifier width.

Official documentation ↗

Gnumeric

Not researched

A standalone regex-extraction formula has not been established from the checked Gnumeric materials; use text tools or research a suitable regular-expression plugin before migration.

Official documentation ↗

Calligra Sheets

Documented

Arguments: REGEXP(text;regexp;[default];[backref])

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

KDE docs explicitly show REGEXP extraction and optional capture group/back-reference.

Official documentation ↗

PlanMaker

Not researched

The PlanMaker 2026 sources used here do not establish regex extraction. Do not interpret that as unsupported.

Official documentation ↗

ONLYOFFICE Spreadsheet Editor

Documented

Version: Added in 9.3 (2026).

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

ONLYOFFICE 9.3 officially added REGEXEXTRACT. Exact argument signature and this example were not verified against the running app, so avoid a presumed copy-paste formula here.

Official documentation ↗

Apple Numbers

Documented

Arguments: REGEX.EXTRACT(text,regular-expression)

=REGEX.EXTRACT("Order 0042","[0-9]+")

Numbers has dedicated regex extraction; quoted pattern syntax should be checked with locale preferences.

Official documentation ↗

Zoho Sheet

Documented

Arguments: REGEXEXTRACT(text;regex;[return_mode];[case_sensitivity])

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

Default mode 0 extracts the first matching substring. Mode 1 returns all matches and mode 2 returns capture groups.

Official documentation ↗

What changes when you migrate?

Use a test case with leading zeros, then verify both the displayed value and its text/number type.

The similarly named Calligra REGEXP and LibreOffice REGEX functions have different optional arguments and replacement functionality.

For an older tool lacking a documented extractor, a fixed-width RIGHT formula is only a fallback when identifier length is stable.

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-extract. See calculation results (JSON).

Keep the zeros

The source is a literal piece of text, Order 0042. Its first numeric run is 0042, not the number 42. If this represents an invoice or part identifier, preserving the leading zeros is essential. A result that displays “0042” only because of a number format is not equivalent to a text result containing four characters.

Why similar names are misleading

LibreOffice uses REGEX() for extraction when the replacement argument is omitted. Calligra names its extractor REGEXP() and provides a different optional default/back-reference interface. Apple Numbers and Zoho Sheet have explicit extractors (REGEX.EXTRACT and REGEXEXTRACT respectively).

ONLYOFFICE 9.3 introduced REGEXEXTRACT according to its release notes. Because its exact argument signature was not confirmed here, it is classified as documented with a version-specific note rather than being presented as a runnable formula.

A better test set

Check an input with no number at all, one with two separate digit runs, and one with leading zeros. Compare output type, first-match versus all-match behaviour, and how no match is reported. Regex dialect details can change the meaning of shortcuts such as \d or lookaround constructs.

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