Does Scrivener support multiple concurrent search terms? For example, if I wanted to find all the words ending in ly, which means excluding words that have ly buried in the word, like ‘acolyte’,
I can type in 'ly ’ in the search window, and that finds all the words that end in ly followed by a space, but it doesn’t pick up words at the end of the sentence. I can search for ‘ly.’ but that ONLY gets me words at the end of the sentence and none of the words followed by a space. It also doesn’t pick up any words that end in an em dash, question mark or exclamation point either.
I want to be able to search for ‘ly?’, where ? is one of several characters like space, period, question mark, exclamation mark, etc.
With UNIX/Linux, the grep command can do this nicely in a few ways, such as this:
$ egrep “ly |ly.|ly?|ly!|ly-”
With the egrep tool, the pipe symbol (|) acts as a separator of a list of things to search for. Is there an equivalent of this in Scrivener’s search capabilities?
Both Edit > Find > Search in Project (cmd-shift-f) and Edit > Find > Find (cmd-f) support Regex searches.
It uses the Mac’s built-in Perl expression — see S11.7 in the Scrivener manual for details.
I’ve had a quick play with it and as far as I can see
gets close to what you want. \w (word) is the shortcut for [a-z-A-Z0-9].
I must stress, I’m no expert, so please test it yourself. I used this page as a reference: https://github.com/niklongstone/regular-expression-cheat-sheet
That expression appears to have no effect for me.
Found it. I had to first select Regexp from the search menu before it would work.
Sorry, yes - I thought from your first post you knew that but were looking for the right expression to use.
Yeah, I just assumed you could type the regexp into the search bar. Thanks
\w+ly\b as a RegEx search works well for this, \b is a word boundary, so it ensures your word ends in the “ly” without including any of the following characters, and \w+ will catch all the letters preceding the ly. This highlights the full word in the editor, which I find nicer visually.
You can save the search as a collection so it’s easy to flip on any time you want.