liveBook · Manning

Delimiter pattern

As explained in Prompt Engineering in Practice

A prompt pattern that uses delimiters to distinguish input parameters or content regions.

The delimiter pattern organizes complex prompts by separating instructions from variable content. Clear section boundaries make reusable templates easier to populate, maintain, review, and debug, especially when they combine multiple data sources. section 4.3

Structure a template by giving each input a labeled boundary:

  • Use headings to identify sections and separators to mark transitions. section 4.3
  • Fence variable content such as logs, code, or copied text so it does not blend into instructions. section 4.3
  • Choose delimiters that do not appear inside the input; switch delimiter types if conflicts arise. section 4.3
Table 4.1 Choosing your delimiters

Delimiter type

Best used for

Triple backticks ( ``` )

Data or content with special characters; can specify input types like ```json or ```sql

Markdown headings ( # Section) with separators ( ---)

Human-readable prompt sections that keep each input source easy to identify

XML tags ( <data>...</data>)

Semantic structure or nested organization

Compare delimiter choices: fenced blocks suit special-character content, Markdown headings and separators clarify human-readable sections, and XML tags support semantic or nested structure. section 4.3

Multisource bug analysis

A production bug template can place an error log, recent change summary, and relevant code in separate headed and fenced sections, then ask for the most likely root cause in one sentence. This makes each source easy to identify and update independently. section 4.3.1

For content that contains backticks, XML tags can separate the input from the instruction. The pattern mainly improves organization; it does not depend on a particular response change. section 2.7.2 section 4.3

How Prompt Engineering in Practice covers it

How deep it goes
Explains headings, separators, fences, and delimiter conflicts, while focusing on template design rather than response differences.
Examples
Demonstrates a production bug analysis template combining an error log, change summary, and code context.
What it assumes
Builds on familiarity with delimiters and assumes prompt instructions can be separated from variable content.
What you can do after
Apply it via headings, separators, and fenced blocks to organize reusable prompts with multiple inputs.
How it connects
Connects delimiter organization to prompt templates and structured prompt sections.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Prompt Engineering in Practice. The section links point to the parts of the book it draws on.