Using Regular Expressions in Your Scrivener Editing Process

Loading

laptop on desk with coffee, phone, and notebooks
Photo by Denise Jans on Unsplash

(Updated 15-Nov-2022.)

This article contains affiliate links, meaning we’ll earn a small commission if you purchase products through these links.

I love writing and organizing in Scrivener. It’s like a master notebook where I can keep all of my ideas, notes, and drafts. But as great as Scrivener is for the planning and writing process, I’ve struggled to use it for editing until now. I finally figured out how to organize my editing process.

If you aren’t familiar with how Scrivener works, it’s like an organizer that lets you write in pieces, then rearrange those pieces easily when you need to mix them up. You can label your scenes, set up metadata to help organize, and mark each scene with an appropriate status to keep track of where you are in your writing process.

The problem I’ve run into is staying organized during editing. Tools like ProWritingAid and Hemingway are nifty and extremely helpful, but work best when tackling your manuscript in small bits. Chapter by chapter or part by part. This takes forever and is downright discouraging.

Not only is it time-consuming, but editing in pieces can also cover up issues that are obvious when you read the manuscript in its entirety. An odd word appearing one or two times in a chapter doesn’t seem so bad, but if you continue that pattern in a thirty-chapter book, that one word becomes a glaring annoyance to your reader.

And editing in Scrivener wasn’t the easiest thing for me until I discovered how to use the Regular Expressions feature (RegEx) in the Project Search function.

The term Regular Expressions refers to a method for matching patterns in text. Software developers and network engineers use them extensively in the IT world. Think about when you’re setting up a new password and the web page warns you that your first character must be a letter and you must capitalize it. The code behind the page is checking your input using a regular expression to make sure it matches the pattern required.

How Does It Work?

So where do we find this robust tool in Scrivener? It’s in the Project Search function. The steps below describe how to use RegEx in Scrivener v 3 for Mac. If you use Windows or a different Mac version, these steps may vary. (Bonus tip: The Scrivener Help function is fantastic for finding functionality within the application.)

Step 1: Open the Project Search bar.

You can open the Project Search bar several ways:

  • Using the menus, click on Edit > Find > Search in Project or
  • Hit Shift+Cmd+F or
  • Click on the Search button icon with the magnifying glass icon in the toolbar

Step 2: View the Options

Once the Search window has opened up, left-click on the drop-down button inside the search box (it has a magnifying glass next to it) to see the options.

Step 3: Select the required options RegEx and Case Sensitive.

Adjust the other options to specify which documents/sections you want to include in the search. (When I’m editing, I want to focus on the Text within the Manuscript.)

Scrivener search options

Step 4: Type in the regular expression code in the search box and results will appear in Binder.

In the example below, the scenes found contain either “some of” or “all of”.

sample Scrivener regular expression code

Using RegEx While Editing

Now that we know where to use it, it’s time to discuss how to use it. I’m a checklist person. I like to have a list of actions that I can check off when I’ve completed them. And I love Scrivener’s Corkboard view for seeing everything at a glance. So I’ve combined these into a workable solution for me.

Don’t worry, if this process doesn’t work for you, Scrivener is flexible enough for you to find a way that fits your needs.

The way I track common editing problems is to set up an “Editing Checks” folder in the Binder and add note cards for each editing task. As I complete editing for each task, I change the label, status, and icon of the note card. The process looks like this:

Step 1: Set up Editing Checks folder in Binder.

  • Scrivener allows you to drag-and-drop items from other Scrivener files, so I keep a Writer’s Notebook file that has all of my default tools. I have this folder in my base template for new projects, but any for existing projects that are missing this Editing Checks folder, I simply drag it into the project binder.
  • To help further organize my editing, I have all of my note cards grouped by what they are targeting. For example, I group all of my rules for punctuation and spelling together just like my rules for “Show don’t tell”.
list of common editing checks

Step 2: Choose the first task and copy the RegEx code into the Project Search box.

Each note card contains both an explanation and the RegEx code to find the text. (Tip: To make the Status visible on the note card, while in Corkboard mode, select View > Corkboard Options > Show Status Stamps.)

screenshot of editing corkboard view

Step 3: Click on each document found and review the highlighted text.

  • Remember, not everything found needs changing. Perhaps the issue identified is in dialogue and your character would absolutely say it that way.
  • Refresh the list of documents by selecting the Search box (where your RegEx code is) and hitting Enter. This is important, as you may have multiple instances of the same item in one document and you want to catch them all.

Step 4: Update the note card

After revising all instances, change the label, status, and icon to mark that editing task complete.

  • My labels are used to show what stage of writing I am in: Outlined, First Draft, Edited, Final Draft, etc. I change the label of the task to reflect where in the process I fixed these problems. My head tells me to wait until I finish all of my development edits before addressing some of these issues (so I won’t have to do them again), but my heart wants to work on cleaning things up right away. So I track them and know that I will have to go back and do these searches again. At least the number of items found won’t be as big next time.
  • I use three statuses for editing tasks: To Do, Reviewed, and Done. Nothing gets marked “Done” until it’s the last time I’m ever going to do it. (You know, in the final, final, really final draft!)
  • Changing the icon is optional, but it feeds my need for visual organization and my obsession with ticking things off.
    • For story-related revisions that I’m pondering, I use the question mark icon to show I need to decide on whether I really want to make this revision.
    • When I’ve completed an editing task, I change the icon to the To Do (Ticked) icon. This gives me one more visual cue, so I can see at a glance what I’ve done and what still needs doing.

So there you have it. This is my current method for writing and editing. I qualify it as “current” because I’m finding that my writing process is an ever-evolving thing that changes as I learn more and hone my craft.

RegEx Resources

Now, if you search the Internet for regular expressions, you’re going to wind up with a ton of articles directed towards developers. Don’t go there! It’s highly intimidating.

Here is a list of resources I found when creating my personal cheat sheet that weren’t too technical or deep:

RegEx Patterns for Your Collection

To help you get started with your own editing collection, here are some of my favorite RegEx patterns. You can change each one appropriately to fit your particular issues.

RegEx PatternWhy use it?
\s\-\sSearches for single dashes. Use this to determine if an ’em’ dash should have been used.
(”|")[.,?!]Finds commas and full stops outside quotation marks (for US English).
[.,?!](”|")Finds commas and full stops inside quotation marks (for British English).
(?! a uniform)(?! a united)(?! a unique)(?! a universal) a [aeiou]\w+Finds words that begin with a vowel immediately preceded by an “a” rather than “an” with exceptions for certain words begin with a “u”.
\w+, \w+ andFinds missing Oxford commas.
\w+, \w+, andFinds instances of Oxford commas (so you can remove them if you don’t want them).
(?<!etc)(?<!vs)(?<!e.g)(?<!i.e)(?<!\.\.)\.\s[a-z]Finds missing capital letters after the end of a statement, question, or exclamation. Excludes “etc.”, “e.g.”, “i.e.”, and “vs.”.
\b(\w+)\s+\1\bFinds any repeated words.
[^\S]\d{1,2}(?!\d)(?!\))(?!\-)(?!\:\d{2})Finds numbers under 100 (so you can write them out with words).
there\s(is|are)Finds phrases that begin with “there is” or “there are”
(was|were)\s\w+ingFinds phrases that use “ing” words with “was” or “were”.
it's|he's|I'm|'llFinds contractions with future tense. Note that the expression “he’s” also finds “she’s”.
\s(saw|heard|smelled|tasted)\sFinds sensory verbs (so you can get more descriptive).
\s(in\sorder|start|going|about|tend|try)\stoFinds unnecessary verbs used with “to” (start to, going to, about to, etc.)
\s(give|gave|took|take)\sa\sFinds phrases “give a”, “gave a”, “took a”, and “take a”. Example edit: Replace “give a kiss” with “kiss”.
he\s(said|asked)Finds instances where he or she “said” or “asked”. Note: “he” will also find “she”.

Conclusion and Wrap-Up

Using regular expressions in Scrivener can help you find specific editing issues in your entire manuscript in one easy search. Mastering this tool will make your life easier and can streamline the editing process on your next work in progress.

Are you already using regular expressions? If so, what are some of your favorites?

Follow me on Twitter at @lancymccall for more discoveries, insights, and surprises from my writing journey.


Related post: Finding Empty Metadata Fields in Scrivener using RegEx


Happy Writing!

This Post Has 10 Comments

  1. Susan Van Sciver

    Wow! I’m going to try this, and I also love your idea of keeping an editing template. Great ideas!

    1. Lancy McCall

      I’m so glad you like it, Susan. Hope your editing process goes well!

  2. Bobby Treat

    Thanks for mentioning me, but it’s better to link the Notion version of my RegEx notes, rather than the old Evernote version.

    1. Lancy McCall

      Hey, Bobby! I have updated the link in the article. Thanks for reaching out.

    2. Ed Skinner

      Thanks for the link to Bobby’s notes on regular expressions in Scrivener. Between his notes and your coverage, I’ve up’d my game a notch or two. Thank you!

  3. Dave Bartell

    Brilliant post. Thank you. Great to have for the next editing cycle. My latest book used “whistled” probably more times than readers might like. Funny how the tendency creeps into writing.

    1. Lancy McCall

      Glad it helped, Dave. My characters were constantly taking deep breaths. 😉

  4. Jake Stoddard

    Hi Lancy,

    Nice article, thanks. Here are a few regular expressions I use:

    \b(and|but|or|nor|yet|so|for|because)\b

    Finds conjunctions, so I can make sure they punctuated correctly.

    (Mr\. |Mrs. |vs\. |i\.e\. |e\.g\. |['’"”]?[^ .!?"”]+['’"“”]?\s){24,}[^ .!?]+\W*?( |$)

    Looks for long sentences (25 words or longer). Change the 24 in the regex to your needs.

    And this beast is to check for when I might be telling emotions instead of showing them:

    \b(accept|admir|ador|afraid|agitat|amaze|amazing|amuse|amusing|anger|angry|anguish|annoy|anticipat|anxiety|anxious|appal|apprehensive|awe|betray|bitter|embitter|certain|certainly|compassion|concern|confiden|conflict|confus|connected|contempt|curious|defeat|defensive|defiant|defy|denial|deny|denied|depress|desire|desiring|despair|desperat|determin|devastat|disappoint|disbelie|disconcert|discourag|disgust|disillusion|dissastisf|doubt|dread|eager|elation|elate|emasculat|embarrass|empath|envy|envious|euphori|excite|fear|frustrat|gratitude|grateful|grief|griev|guilt|happy|happi|hate|hatred|hating|homesick|hope|horror|horri|humbl|humili|hurt|hysteri|impatien|patien|inadequate|incredul|indifferen|insecur|inspir|intimidat|irritat|jealous|loath|lonely|loneliness|longing|longs|longed|love|loving|lust|moody|moodi|moved|movi|neglect|nervous|nostagi|obsess|overwhelm|panic|paranoi|peace|pity|pitious|pleased|pleasing|powerless|pride|proud|rage|raging|regret|relief|reliev|reluctan|remorse|resent|resign|sad|sappy|satisf|scare|schadenfreude|scorn|shame|shaming|shock|skeptic|smug|somber|stun|surpris|suspicio|sympath|terror|terrif|torment|unappreciat|uncertain|uneas|validat|value|vengeful|vindicat|vulnerab|wanderlust|wary|wari|wistful|worry|worried|worthless)\b

    (I created that regex based on the emotions in The Emotional Thesaurus.)

    1. Lancy McCall

      These are great, Jake! I’ll be adding them to my editing collection. Thanks for sharing.

      (I had to fix a formatting issue to get your regex “beast” to show properly! Need to update my style sheet for the website. LOL)

    2. Lee deLacy

      great list, it works but for scrivener must be exact match, uneas does not find uneasy. I modified the string to make all words in your list complete and added some variations.

      \b(accept|admir|ador|afraid|agitate|agitating|amaze|amazing|amuse|amusing|anger|angry|anguish|annoy|anticipate|anxiety|Anxious|apprehensive|awe|betray|bitter|embitter|certain|certainly|compassion|concern|confident|conflict|confuse|confusing|connected|contempt|curious|defeat|defensive|defiant|defy|denial|deny|denied|depress|desire|desiring|despair|desperate|determine|determined|devastate|devastated|disappoint|disappointed|disbelief|disconcert|discourage|disgust|disillusion|dissastisfied|doubt|dread|eager|elation|elate|emasculated|embarrass|empathy|envy|envious|euphoric|excite|fear|frustrating|gratitude|grateful|grief|grieve|grieving|guilt|guilty|happy|happiness|hate|hatred|hating|homesick|hope|horror|horrified|humble|humbled|humiliate|humiliated|hurt|hysterical|impatient|patient|inadequate|incredulous|indifferent|insecure|inspire|inspired|inspiring|intimidated|irritated|jealous|loath|lonely|loneliness|longing|longs|longed|love|loving|lust|moody|moodiness|moved|moving|neglect|nervous|nostagilic|obsessed|overwhelm|overwhelmed|panic|paranoid|paranoia|peace|pity|pitious|pleased|pleasing|powerless|pride|proud|rage|raging|regret|relief|relieved|reluctant|remorse|resent|resigned|sad|sappy|satisfied|scare|scared|schadenfreude|scorn|shame|shaming|shock|skeptic|smug|somber|stun|stunned|surprised|suprising|suspicious|sympathy|terror|terrific|torment|unappreciated|uncertain|uneasy|validate|value|vengeful|vindicate|vindicated|vulnerable|wanderlust|wary|wariness|wistful|worry|worried|worthless)\b

      Thank you a great list

Leave a Reply