Ask Your Question

regular expressions: replace with tab (\t) doesn't work for me [closed]

asked 2014-09-13 08:58:16 +0200

Frank Lekens gravatar image

I'm performing a simple Find&Replace: search for paragraph breaks ($) and replace with a paragraph break followed by a TAB (so as to indent all paragraphs manually with hard tabs, instead of using the indent function -- don't ask why). It doesn't work. I do Find $ & replace by \n\t. But what it does is just type "\t" at the start of each paragraph.

Whereas here it says: "Represents a tab. You can also use this expression in the Replace with box." What else do I have to do? Why doesn't it work like this?

Also, I'm a little confused in the link above by the peculiarity that to search for paragraph breaks you have to enter $, and to replace them you have to enter \n. How does this double function of \n work if you would want to search paragraph breaks and want to replace them by line breaks? Is that not possible in LibreOffice, or is there yet another symbol that represents a line break in the replace box?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-03 17:43:05.921914

1 Answer

Sort by » oldest newest most voted

answered 2014-09-13 09:20:33 +0200

karolus gravatar image


Use search ^. replace \t& instead.


edit flag offensive delete link more


To add to the answer by @karolus, regular expression engines are generally line-based (in LO paragraph-based), so performing find/replace across a paragraph boundary (outside ^ and $) is usually not possible.

oweng gravatar imageoweng ( 2014-09-13 09:59:12 +0200 )edit

Question Tools

1 follower


Asked: 2014-09-13 08:58:16 +0200

Seen: 429 times

Last updated: Sep 13 '14