Tags

No tags :(

Share it

Pretty much any author can use find and replace. But how many can really use it effectively, even to save money? I can. If you read this article, you can, too.

This article will include simple find and replace suggestions. But most authors have never even heard of Regular Expressions. Regular Expressions, often called Regex for short, are really a techies tool for finding a pattern of characters. But you can really fix a lot of issues and know they are 100% fixed without having to wait for an editor to catch them.

However, if you are using Microsoft Word, you may not even know you can use regular expressions, but they are there, though not exactly fully featured, in the Advanced Find when you click More. You have many search options and regular expressions in word will be different if you have Use Wildcards checked or not.

Sigil, an open source eBook authoring tool, has full support for regular expressions. However, because it is html, there is often html tags that you can use, such as </p> which ends a paragraph.

So if you fix as many errors as possible with Find and Replace and regex, you are making the editors job easier. The editor won’t have to spend time to fix them. If you pay your editor hourly, then they will spend less hours and you spend less money. Also, the editor can focus on content and real problems rather than stupid grammatical issues that a computer can automatically fix.

Here is a nice list of what to find that I have created. I will mark them as whether you can using Find and Replace or whether you have to do a manual replace.

Paragraphs that do NOT end with punctuation

(Sorry, this doesn’t fix missing punctuation between sentences in a paragraph.)

Regex: [A-Za-z]$
Sigil: [A-Za-z]</p>
Word: ^$^p

Replace: Manual. Because you as the author must determine the punctuation and because some things that shouldn’t have punctuation, like chapter headings, might be returned in the search.

One or more needless spaces at the end of a paragraph

Regex: [ t]+$
Sigil: [ t]+</p>
Word: ^w^p

Replace:

Regex:          Yes. Leave it blank. Replacing with nothing solves this.
Sigil: </p>;    Replace with only the end tag.
Word: ^w^p      Replace with only the end paragraph symbol: ^p

One or more needless spaces at the start of a paragraph

Regex: ^\s+
Sigil: <p>\s+
Word: ^p^w

Replace:

Regex:          Yes. Leave it blank. Replacing with nothing solves this.
Sigil: <p>      Replace with only the end tag.
Word: ^p        Replace with only the end paragraph symbol: ^p

All sentences that do not start with a capital letter

Regex: [A-Za-z][.?!]["”]*\s+[a-z]
Sigil: [A-Za-z][.?!]["”]*\s+[a-z]
Word: Check the "Use Wildcards" checkbox: [A-z][\!\.\?] [a-z]

Replace: Manual

You can probably replace with only ? and !

Important! There are too many instances of a period after acronyms and shortened titles, Mrs., Mr., Jr., etc., with periods for you to trust this to work without looking at each one.

Here is a couple of sentences that would be wrong if the next character after the punctuation were capitalized.

  • Techroscopic Inc. was the name of his company.
  • “Awesome!” he said.

All end quotes followed by a capital letter to see if should be a lowercase letter.

Example to be fixed: “Go away.” She said.
After it was fixed: “Go away,” she said.

Tip: This helps if the quotes are smart quotes. If you aren’t using smart quotes, you don’t know if a quote is opening or closing. In Word, find and replace a quote ” with itself ” and Word, with default settings, will change all your quotes to smart quotes.

Regex: [^,]["”] [A-Z]
Sigil: [^,]["”] [A-Z]
Word: Check the "Use Wildcards" checkbox: [A-z][\!,]["”] [A-Z]

Replace: Manual

You just have to took at each one.

All opening quotes followed by missing quotes or embedded quotes.

Example of a missing quote: “Hello, she said.
Example of embedded quotes (should be single quotes): “The word “death” means separation.”

Tip: This helps if the quotes are smart quotes. If you aren’t using smart quotes, you don’t know if a quote is opening or closing. In Word, just find and replace all ” with a ” and Word, with default settings, will change all your quotes to smart quotes.

Important! This is not always incorrect. When a speaker speaks for multiple paragraphs, a final quote is not used until the last paragraph.

Regex: “[^”]+(“|$)
Sigil: “[^”]+(“|</p>)
Word: Check the "Use Wildcards" checkbox: ["“][!"”]@^13

Replace: Manual. You have to verify that the dialog doesn’t cross paragraphs.

All closing quotes without opening quotes

Some examples of bad closing quotes.

Example 1 – Missing opening quote: “Hello,” she said. How have you been?”
Example 2: – Extra quote that should be there: “Hello,” she said.”

Regex: (^|”)[^“]+”
Sigil: (<p>|”)[^“]+”
Word: Check the "Use Wildcards" checkbox: [”^13][!“]@”

Replace – Manual

Any quotes that aren’t smart quotes

Regex: [“”’]
Sigil: ^[^>]*<p[^>]*>[^>]*([“”’])[^>]*
Word: "

Replace – Manual, except in Word. In word, replace all quotes and they will all be switched to smart quotes (unless you turned that setting off).

A Comma after a conjunction

This is a stylistic choice, as it isn’t exactly wrong, but I prefer never to have these.

Regex: b(but|and|so|which|yet|or|except), Sigil: b(but|and|so|which|yet|or|except), Word: ”

Repace – Manual. Either move the comma to before the conjunction or delete it.

Find character names you write inconsistently

Find character names you write inconsistently. I use three letters. The first letter, a consistent middle consonant, and the last letter. If your misspellings change the first or last letter, you’ll need to figure out your own.

Examples:

  • Aiden
  • Adien
  • Aeden
  • Adan
  • Adin
  • Adn
Regex: A\w*d\w*n
Sigil: A\w*d\w*n
Word: Check the "Use Wildcards" checkbox: A([aei]@)[d]([aei]@)n

Replace: Aiden (or your correct spelling)

Example 2

  • Neihan
  • Neihan
  • Niehan
  • Nihan
  • Nehan
  • Neihen
  • Niehen
  • Nihen
  • Nehen
Regex: N[ie]{1,2}h[ae]n
Sigil: N[ie]{1,2}h[ae]n
Word: Check the "Use Wildcards" checkbox: N([ie]@)h[ae]n

Expect me to continue to update this article. The next step is to create a tool that will find these sentences for me (or you if I give you the tool). I already have a tool, it is just time to use it.