I´m looking to realise the following problem: I have a list of words (which I often use but don´t like to use…and have to find them. Bad behavor.) and want to search and highlight them in my text.
Something like this here: schreiblabor.com/textlabor/filler/
Is this possible to do with scrivener? I tryed alot, but dosn´t find a way.
The search field in the toolbar can do this. Click on the magnifying glass icon within the text area to set it to “any word”, and then enter as many of the words as you like. They just have to be separated with spaces. That will create a list of documents in your project where the binder usually shows. Click on the magnifying glass again and at the bottom of those options is “Save Search…”. Click on that to create a “collection” that you can return to whenever you want to find those words in your project.
If there are too many words to paste into the search, you could create multiple saved searches this way.
One preference that makes using the search feature for this purpose a bit nicer is in the Editor pane, top-left corner, “Typing clears search highlights”. With that off you can edit a word out without disturbing the other highlights.
ok, I tried. But it work not very well. 1: if my list contains a phrase, its only searches for the single words (“ganz und gar” searches ganz + und + gar) and 2: it also searches “inside words” (e.g.: “auch” also highlighs Rauch)
So, the online version I named below works much better. But its not nice to copy and past 50K words or more from and into scrivener…
Instead of the Any Word search, switch to using RegEx and then enter your search like this:
\b(term|term2|phrase to find)\b
The \b on either end indicates the word boundaries, so if you’re searching for “if” it won’t return “Eiffel”, like using a Whole Words search. The vertical bars indicate “OR”, so the list is treated like the “Any” search previously, returning the document if it includes any of the search terms. The parentheses group the terms to simplify the expression, so you only have to put the \b in on either side of that instead of for each individual term.
Ah, I hadn’t realized that “Any Word” and “Whole Word” options couldn’t be used in combination. Sorry about that.
I’d suggest you construct that \b(word|phrase)\b expression in a document or the Project Notes, so that it’s easy to edit if you want to add or remove words. You’ll be able to copy & paste it into the rather small search bar that way.