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.