Find and replace -- how to exclude a certain number

Discuss the word processor

Find and replace -- how to exclude a certain number

Postby Straitsfan » Mon Jan 22, 2018 12:57 am

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
Straitsfan
 
Posts: 22
Joined: Mon Sep 29, 2008 11:31 pm

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

Postby acknak » Mon Jan 22, 2018 5:27 am

... 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
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

Postby Zizi64 » Mon Jan 22, 2018 8:47 am

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; LO4.4.7, LO5.4.6 on Win7x64Prof.
PortableApps, winPenPack: LO3.3.0-LO6.0.2 and AOO4.1.5
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.
User avatar
Zizi64
Volunteer
 
Posts: 6603
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Writer

Who is online

Users browsing this forum: Exodus and 17 guests