Ask Your Question

How can I use regular expressions in find and replace to add a leading zero

asked 2015-01-22 04:36:19 +0200

tenntexj gravatar image

I want to make all the endnote text numbers that appear after a period and are followed by an empty space two digit numbers like 01, 02, 10, 11, instead of 1, 2, 10, 11.

Is there a combination of general expression symbols that can be used in the "search for" and "replace with" fields of the Writer "find and replace" operation that will add a leading zero to every single digit number while not affecting double digit numbers to make all numbers be double digit numbers?

It does not appear to me that this is possible, but if it is, I would like to find out how.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2015-01-22 13:57:01 +0200

Lupp gravatar image

You cannot use 'Find & Replace' (and thus no regular expressions) for the purpose because the footnote/endnote labels are neither text nor numbers contained in the text but special fields including a linkage generated by a background process. Even if you define a footnote label to be 01 by explicitly entering this (left of the 'Character' button) and waiving automatic incrementation you will not find it using 'Find & Replace' whether or not using a regex.

As > 'Tools' > 'Footnotes/Endnotes...' does not offer numeric formats with leading zeros there will be no way to fulfil your wishes without enhancing the source code. You may file a feature request.

edit flag offensive delete link more

answered 2015-01-22 12:58:50 +0200

ajgor74 gravatar image

for my experience, it's not possible, because of "numbers" in writer are just "simple text", characters, and you can not change the format in the same way calc does.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-01-22 04:36:19 +0200

Seen: 1,248 times

Last updated: Jan 22 '15