# How to add line break to search and replace [closed]

In many documents I have the following:

| | *


What I require is

| |
*


i.e. I need to find | | * and replace this with | | and then a line break and then *

How do I do this? Any help greatly appreciated :)

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2015-11-07 10:59:48.146084

Sort by » oldest newest most voted

If I understand correctly (and asterisk is a literal * rather than a wildcard), then you need to:

1. Do CTRL-H to bring up the Find & Replace dialog
2. Click on "More Options" (bottom left button)
3. Make sure "Regular expressions" is checked/selected
4. Then in your "Search for" box, enter: \| \| \* and in the "Replace with" enter: | | \n*

That should do it. (Although in your example, you have some spaces in front of the asterisk?) You might want to un-check "Regular expressions" next time you do search-replace.

For more help on Regular Expressions, have a look at the LibreOffice help, or this useful OpenOffice "how-to".

more

1

Thanks David, Works just as required :)

( 2013-08-27 02:27:19 +0100 )edit

Great help.. Thanks a lot ;-)

( 2015-02-15 05:59:59 +0100 )edit

David's Find and Replace steps do work, but I've found the Alternative Dialog Find & Replace extension to be easier to use (and has more options): http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer

more

@Edward - great extension, and I use it quite a bit. Not sure how it helps in this particular case, though, and it can be tricky to use. Could you help out OP by suggesting how you would use this extension to accomplish his search/replace? Thanks!

( 2013-08-26 18:08:29 +0100 )edit

Great help.. Thanks a lot ;-)

( 2015-02-15 05:59:04 +0100 )edit