|
While writing Duplicity (and editing Centricity), I vacillated on my number formatting. There are different options, but like most formatting decisions, whichever standard you choose, it should be consistent. So, I needed a way to quickly find all the numbers in my manuscript. It’s super slow to search for each number one at a time. Regular expressions to the rescue!
I feel like I’m late to this party. Fashionable late? Probably not. Regular expressions (regex) are powerful search parameters that allow for highly customizable targeting. Most word processing software has, within its search function, a regular expressions input option. While they may look intimidating at first, regex can save hours of manual editing by automating tasks like finding repeated words, checking formatting, cleaning drafts, and analyzing text patterns. The one I used for locating numbers in my manuscript: -?\b\d+(?:\.\d+)?\b It will find integers, decimals, and even negative values. Additional expressions: For catching repeated words, \b(\w+)\s+\1\b highlights duplicated words such as “the the” or “and and.” If you're editing dialogue, you might want to identify lines that start with extra spaces. The pattern ^\s+ will flag leading whitespace at the beginning of lines. To locate all capitalized words \b[A-Z][a-z]+\b is useful for scanning proper nouns or ensuring character names are spelled consistently. You can even check sentence spacing with \.\s{2,} It helps find places where two or more spaces appear after a period. Adding a few regex tools to your repertoire will make your editing process faster and more precise. At least, it has for me. There are a huge number of expressions out there, so hunt down the ones you need and make your life a little easier. Happy writing!
0 Comments
|
DREAD ORANGE
|
RSS Feed