wildcard to use in find & replace

I have a large document with a large number of identical strings except that each has a different 16 digit number in it. I want to completely remove all the strings. Can I use find and replace in some way to do this using LibreOffice Writer?

Find & Replace in LibreOffice doesn’t support ‘Wildcards’ the way MS Office does.
How would you describe with wildcards what you need?
Regular expressions can do next to every job of this kind.

Wildcards may be too short of power to do such a task. Fortunately LibreOffice supports the much more powerful regular expressions.

You need to give a complete and unambiguous syntactical description of the strings you want to delete which is able to strictly distinguish them from all the other text to be preserved. If you can assure that the strings to delete never contain a space and contain exactly 16 subsequent decimal digits but no additional digits elsewhere while otherwise nowhere in your document occur 16 subsequent decimal digits, such a syntax is describable by the RegularExpression (“RegEx”) [^ \d]*\d{16}[^ \d]*. Regard the spaces! If you also want to impose additional condistions (concerning the delimiters in front and behind e.g.), make clear how they are and ask again if necessary. (Edit your question for the pupose or add a comment to this answer. Don’t use the ‘Answer’ tool for it.)

Having found a RegEx exactly describing what you want, call F&R (Find & Replace, default shortcut Ctrl+H), enable regular expressions, and enter your expression behind Find:. Leave the place behind Replace: empty (or fill in what you need). Then first check with Find All if your RegEx works as expected. If so use Replace All.

You need to use Regular Expressions: in the full S&R (Ctrl H), look under “more options” and activate the regular expressions. Depending on how the string of numbers is in the document, you’ll need different expressions. For example, if the numbers are “alone” (spaces surrounding them) you can use

\b\d{16}\b

where \b indicates a “word boundary,” \d a digit and the number between curly brackets how many digits you want.

If the string is attached to some text, it became complicated. For example, if you have something like “text<16 digits>” the expression

(?<=[^[\d|\s]])\d{16}\b

looks for some text followed immediately by 16 digits and a “word boundary” and only selects the numbers.

Regular expressions can be complicated. You can check the ICU documentation or, ejem, the corresponding chapter in my free book about Writer :wink:

New ICU’s Regular Expressions page.