[Writer] Regular expressions

gordom,

a macro can do the job , have a look at the standard LibreOffice macro's you find in every document)

you can also tranfer the text to a spreadsheet and use formula like if(left(cellstring,3) = 'set:');'nothing', cellstring)
then recopy to spreadsheet to a writerdoc and replace 'nothing'

hope it helps

Fernand

...

In "real" life :slight_smile: there are lines starting with letters also. Only
these with "Set:" at the beginning should be left, rest is going to be
deleted.

Set: 01SA34509
0109SA
011017B
S01020207B
010902B
01090002
011007B
01090001
090110
Set: 0134501
011101
HB01110102
01110103
080908
Set: 0111679SE
0111SE

I'm surprised that there is no simple way to find everything except
"Set:.+$"

...

If you are going to have to do this on a 'regular basis' (pun intended),
install AltSearch[1] & then use select Regular Expression and:

\p[:alnum:]+\p

That will select all except the 'Set:' lines. You can then replace with
blank.

[1]
<http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer>
- Help: <http://www.volny.cz/macrojtb/HelpAltSearch_en.html>

In this very case, if the Set lines are the only ones with a colon,
then this is suddenly a very easy two step task:
First replace ^[^:]*$ with nothing, then replace ^$ with nothing.
Done. But I guess that is not always the case, I'm not sure if that
was mentioned earlier in this thread. If so, sorry for bothering
again.
Maybe someone already suggested this, and I totally missed it as usual.

Johnny Rosenberg

...

If you are going to have to do this on a 'regular basis' (pun intended),
install AltSearch[1] & then use select Regular Expression and:

\p[:alnum:]+\p

That will select all except the 'Set:' lines. You can then replace with
blank.

Correction: you can then replace them with: /p/p

...