Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index

At 18:56 27/10/2013 -0500, T. R. Valentine wrote:
On 27 October 2013 18:50, Tim Lloyd wrote:

I think you read my question incorrectly.

That's because your original question was not at all clear! (You owe it to correspondents not to waste their time.)

Specifically, I am able to use regular expressions to search for a one to many-digit number: \d* But I want to leave the number (whatever it may be) in place and insert a tab immediately after it. I expected I should be able to use: \1\t but LO is interpreting the \1 *literally* instead of as a backreference.

There are two things wrong here, I think. First, although \1, \2, and so on can be used to refer back to parts of the "Search for" field *within the "Search for" field itself*, the corresponding syntax in the "Replace with" field is $1, $2, and so on. But then you also have to mark which part of the matched string you want to refer back to - and you do that using parentheses in the Search field.

If you want to refer to the entire matched string using $1, you must use (\d*) as your search string. But - easier than that - you can always refer to the entire matched string using the ampersand: & (or you can use $0). In that case the parentheses are unnecessary in the search string: you would search for \d* and replace with &\t.

I trust this helps.

Brian Barker

To unsubscribe e-mail to:
Posting guidelines + more:
List archive:
All messages sent to this list will be publicly archived and cannot be deleted


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.