Ask Your Question

fin&replace, not to find other words [closed]

asked 2013-11-04 10:37:43 +0200

altair gravatar image

updated 2020-08-16 12:50:00 +0200

Alex Kemp gravatar image

Hello! If we have a sequence:

char long character char character character long character characterchar character characterlong character character charcharacter character longcharacter

how do we achieve by find&replace just the words "char" and "long" to be captured, but not the word "character" nor any part or letter of it?

Many thaks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-12 20:28:04.174290



In Find&Replace dialog check "Whole words only" or try find "char" with a space before and after word " char ", of course include word which haven't leading space.

B.Horvat gravatar imageB.Horvat ( 2013-11-04 11:07:42 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-11-04 11:18:56 +0200

oweng gravatar image

As @B.Horvat has indicated, there is no single regular expression in LO that will find all required instances. This will find all but the very first instance of "char":

[^a-z](char|long)[ ]

This will find the first instance only:

^(char|long)[ ]
edit flag offensive delete link more


^(char|long)[ ] does not find any obtion at my pc. What is this expression supposed to do? Many thanks!

altair gravatar imagealtair ( 2013-11-04 13:01:31 +0200 )edit

^ == beginning of line, then either "char" or "long", followed by a single space [ ]

oweng gravatar imageoweng ( 2013-11-08 07:38:10 +0200 )edit

Question Tools

1 follower


Asked: 2013-11-04 10:37:43 +0200

Seen: 196 times

Last updated: Nov 04 '13