Find and replace -- how to exclude a certain number

Discuss the word processor
Post Reply
Straitsfan
Posts: 22
Joined: Mon Sep 29, 2008 11:31 pm

Find and replace -- how to exclude a certain number

Post by Straitsfan »

Is there any way to use find and replace to exclude a certain number of characters in a search? For example, what if I wanted to find if there are any occurrences of a space that less than or greater than 2, but not exactly two? Trying to figure this out but having trouble with the wildcard list, if this is even possible.
LO 5.2.3.3, OS X El Capitan
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Find and replace -- how to exclude a certain number

Post by acknak »

... occurrences of a space that less than or greater than 2, but not exactly two
Sorry, I'm not sure I understand what you're doing/looking for. Two what?

Maybe you mean two spaces in a row? If so, you can match either one space, or more than two spaces, with something like
Edit > Find & Replace
Search for: \S(\s|\s{3,})\S
Options/Match case: ON
Options/Regular expressions: ON

Click Find or Find All
AOO4/LO5 • Linux • Fedora 23
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Find and replace -- how to exclude a certain number

Post by Zizi64 »

what if I wanted to find if there are any occurrences of a space that less than or greater than 2, but not exactly two?
Start with searching (and replacing) the more than two occurrences if you using the "search and replace" function in normal mode. Because the three occurrences contain the two occurrences too. ("aaa" contain the "aa" pair: the search function will found it.)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply