01 // Community GREP library

InDesign GREP examples, tested and ready to copy

Copy a tested expression for Find/Change or GREP styles. Every pattern is shared by a designer, with their name on it.

Run all of these at once with the free GREP Batch Processor.

New to GREP? Learn the basics in 10 minutes All special characters

50tested patterns
$0free forever

All GREPs

TypographyInDesign GREP

Straight to curly quotes, step 2: closing quotes

Step 2 of 2. After step 1, every straight double quote that is left closes a quote, so it becomes a closing curly quote. Always run step 1 first.

Find
BeforeHe said “yes" and left.
\x{0022}
Change to
AfterHe said “yes” and left.
~}
Regular space
TypographyInDesign GREP

Straight to curly quotes, step 1: opening quotes

Step 1 of 2. Turns a straight double quote into an opening curly quote when it starts a paragraph or follows a space or an opening bracket. Run step 2 right after it.

Find
BeforeHe said "yes" and left.
(^|[\s(\[])\x{0022}
Change to
AfterHe said “yes" and left.
$1~{
Regular space
CleanupInDesign GREP

Multiple spaces to one space

Replaces two or more regular spaces with a single space, a common problem after a Word import. Tabs, em spaces and other special spaces are left alone, so layout spacing is not touched.

Find
BeforeThe book was ready.
{2,}
Change to
AfterThe book was ready.
Regular space
Numbers and pricesInDesign GREP

Normalize phone number separators

Standardizes US phone number format to hyphen separators. Changes 555.123.4567 to 555-123-4567.

Find
Before555.123.4567
(\d{3})[.\s](\d{3})[.\s](\d{4})
Change to
After555-123-4567
$1-$2-$3
CleanupInDesign GREP

Add leading zero to hour

Adds leading zero to single-digit hours in time notation. Changes 9:30 to 09:30 for 24-hour format consistency.

Find
Before9:30 AM
\b(?<!\d)([1-9]):(\d{2})\b
Change to
After09:30 AM
0$1:$2
Regular space
TypographyInDesign GREP

Doubled punctuation before a dash

Reduces multiple punctuation marks before dashes to a single mark. Captures first punctuation and removes duplicates.

Find
BeforeHello!!—world
([.!?])[.!?]+(?=[—–-])
Change to
AfterHello!—world
$1
CleanupInDesign GREP

Fix spaced thousands separator

Converts space-separated thousands to comma-separated. Changes 1 000 to 1,000 for US number format.

Find
Before1 000
(\d)\s(\d{3})(?=\b)
Change to
After1,000
$1,$2
Regular space
TypographyInDesign GREP

Apostrophe in decades like ’90s

Converts straight apostrophe to curly in decade abbreviations like '90s, '80s, '70s. Uses lookbehind for space and lookahead for two digits followed by 's'.

Find
Beforethe '90s
(?<=\s)'(?=\d{2}s)
Change to
Afterthe ’90s
’
Regular space
TypographyInDesign GREP

Replace spaced ranges with en-dash

Converts spaced hyphens between numbers to closed en-dash. Fixes '10 - 20' to '10–20' range format.

Find
Before10 - 20
(?<=\d)\s+-\s+(?=\d)
Change to
After10–20
–
Regular space
TypographyInDesign GREP

Convert dumb apostrophes in French elisions

Converts straight apostrophes to curly in French elisions (l'amour, d'accord, c'est, etc.). Case-insensitive pattern targets common French elision letters.

Find
Beforel'amour
(?i)\b([cdjlmnstqu])'(?=\w)
Change to
Afterl’amour
$1’
TypographyInDesign GREP

Remove stray closing quote mid-word

Removes closing curly quote appearing between word characters. Cleans up import artifacts where quotes ended up inside words.

Find
Beforewo”rd
(?<=\w)”(?=\w)
Change to
Afterword
Leave empty: the match is deleted
TypographyInDesign GREP

Normalize em-dash dialogue

Adds space after em-dash at start of paragraph when followed by word. Fixes European-style dialogue formatting.

Find
Before—Hello
^(—)(\w)
Change to
After— Hello
— $2
Regular space
TypographyInDesign GREP

Missing space after a closing quote

Adds missing space after closing quote when not followed by space or punctuation. Fixes run-together text after quoted sections.

Find
Before“Hello”The next
”(?![\s.,!?;:])
Change to
After“Hello” The next
”
Regular space
CleanupInDesign GREP

Fix spaced colon in time

Removes spaces around colon in time notation. Normalizes 10 : 30 to 10:30 format.

Find
Before10 : 30
(\d)\s*:\s*(\d)
Change to
After10:30
$1:$2
Regular space
References and TOCInDesign GREP

TOC dot leaders to a tab

Converts multiple dots (manual dot leaders) to tab before page numbers. For TOC cleanup.

Find
BeforeChapter One.....5
\.{3,}\s*(?=\d)
Change to
AfterChapter One 5
\t
Regular spaceTab
TypographyInDesign GREP

Hyphen bullets to real bullets

Converts hyphens used as bullet markers at the start of lines into proper bullet characters. Commonly needed when importing plain text or markdown.

Find
Before- item
(?m)^-\s*(?=\w)
Change to
After• item
•
Regular space
References and TOCInDesign GREP

Trailing dot after a TOC page number

Removes period after page numbers at line end. Cleans up TOC and index formatting.

Find
BeforeChapter One 15.
(?<=\d)\.(?=\r|$)
Change to
AfterChapter One 15
Leave empty: the match is deleted
Regular spaceTab
CleanupInDesign GREP

Doubled ?? and !!

Reduces multiple exclamation or question marks to single. Removes emphatic multiple punctuation like !! or ??.

Find
BeforeWhat??
([!?]){2,}
Change to
AfterWhat?
$1
CleanupInDesign GREP

Missing space after a comma

Adds missing space after comma when followed by letter. Fixes run-together text like 'hello,world'.

Find
Beforehello,world
,(?=[A-Za-z])
Change to
Afterhello, world
,
Regular space
Names and listsInDesign GREP

“First Last” to “Last, First”

For author lists and indexes: one name per paragraph, with an optional middle initial, becomes surname first.

Find
BeforeMary J. Watson
^([A-Z][a-z]+(?: [A-Z]\.)?) ([A-Z][a-z'-]+)$
Change to
AfterWatson, Mary J.
$2, $1
Regular space
CleanupInDesign GREP

Word typed twice

Catches doubled words in any case, like “the The” at a line break in the manuscript, and keeps the first one.

Find
Beforeand the The house
(?i)\b(\w+)\s+\1\b
Change to
Afterand the house
$1
Regular space
Names and listsInDesign GREP

Hand-typed numbers like “1)” or “1.”

Strips manual numbering at the start of paragraphs before you apply an automatic numbered list style.

Find
Before3) Bake for 20 minutes
^\d+[.)]\s+
Change to
AfterBake for 20 minutes
Leave empty: the match is deleted
Regular space
TypographyInDesign GREP

Text inside square brackets

Matches only what is between the brackets, for example to italicize editorial notes like [sic] while the brackets stay upright.

Find
Beforethe [sic] spelling
(?<=\[)[^\]]+(?=\])
Change to
Afterthe [sic] spelling
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
GREP stylesInDesign GREP

Ordinal suffixes after a number

GREP style with a superscript character style. The word boundary keeps it off words like “1stop”.

Find
Beforethe 2nd and 23rd
(?<=\d)(?:st|nd|rd|th)\b
Change to
Afterthe 2nd and 23rd
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
GREP stylesInDesign GREP

Last two words of a paragraph together

GREP style with a No Break character style, so the last line of a paragraph always has at least two words.

Find
Before…and then it rained.
\S+ \S+$
Change to
After…and then it rained.
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
GREP stylesInDesign GREP

All-caps words in small caps

GREP style for words of three or more capitals, set as OpenType all small caps so acronyms don’t shout.

Find
BeforeAsk NASA and the FBI
\b[A-Z]{3,}\b
Change to
AfterAsk NASA and the FBI
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
Numbers and pricesInDesign GREP

Prices in dollars, euros, and pounds

Finds prices with thousands separators and optional cents, ready for a price character style.

Find
BeforeWas $1,299.00, now €899
[$€£]\d{1,3}(?:,\d{3})*(?:\.\d{2})?
Change to
AfterWas $1,299.00, now €899
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
Links and emailInDesign GREP

Email addresses

GREP style with a character style set to No Language, so email addresses never hyphenate.

Find
BeforeWrite to orders@press.com today
[\w.+-]+@[\w-]+(?:\.[\w-]+)+
Change to
AfterWrite to orders@press.com today
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
Links and emailInDesign GREP

Web addresses

Finds addresses starting with http or www, without the punctuation that ends the sentence. Use a No Language style to stop hyphenation.

Find
BeforeVisit www.press.com/books.
\b(?:https?://|www\.)\S+[^\s.,;:!?)]
Change to
AfterVisit www.press.com/books.
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
CleanupInDesign GREP

Empty paragraphs

Deletes the blank paragraphs people type for spacing, so Space Before and After can do the job.

Find
BeforeIntro


Chapter
(?<=\r)\r+
Change to
AfterIntro
Chapter
Leave empty: the match is deleted
Paragraph return
CleanupInDesign GREP

Spaces around tabs

Cleans up spaces typed before or after a tab, so tab stops line up exactly.

Find
BeforeItem 12
*\t *
Change to
AfterItem 12
\t
Regular spaceTab
CleanupInDesign GREP

Spaces at the start of a paragraph

Removes spaces and tabs used to fake a first-line indent. Use the paragraph style’s indent instead.

Find
Before Once upon a time
^[ \t]+
Change to
AfterOnce upon a time
Leave empty: the match is deleted
Regular space
Numbers and pricesInDesign GREP

Simple fractions

Finds one- or two-digit fractions like 1/2 or 3/4 for a fraction style, and leaves longer number groups such as dates alone.

Find
BeforeAdd 3/4 cup on 10/12/2026
(?<![\d/])\d{1,2}/\d{1,2}(?![\d/])
Change to
AfterAdd 3/4 cup on 10/12/2026
Leave empty and apply a style in Change Format, or use as a GREP style
Regular space
References and TOCInDesign GREP

“Figure 3” to “Fig. 3”

Shortens figure references when a number follows, and leaves the word “figure” in normal text untouched.

Find
Beforesee Figure 12 and the figure
\bFigure\s+(\d+)
Change to
Aftersee Fig. 12 and the figure
Fig. $1
Regular space
02 // Contributors

Contributors

Members who share a GREP get their name on the pattern and a profile page with photo, bio, and links.