Trying to replace character using Regex but do not work

trying to remove line break except dot, but looks like find / replace detect the regex but can not replace


LO Writer regex don not work.odt (13.4 KB)

Any help?

Find: $
Edit: remove period that shouldn’t be there

Replace: Space or whatever you require.

List of Regular Expressions

for me do not work

in this image the regex [^.]$ is correctly detected, but when press the replace button do nothing.

See my edit removing period (full stop) that shouldn’t be there.

using only $ the replace work, but I need add [^.] because I need to replace all line break except when a dot is the last character

Try the AltSearch extension as recommended in the following thread. Attention: You don’t have line-breaks, but paragraph-breaks.

1 Like

warning: in regex, . stands for any character.
to match an actual dot, you need to despecialized it → \.

[^\.]

Are you sure? In square brackets you do not have to mask any character, it is literally “understood”. IMO

3 Likes

no fully,
but in this case you’re correct.