Performance, Debugging, and Multiline Search/Search across line boundaries

Allow regex matches to span multiple lines.

Section: Multiline and structured-text searches

Search across line boundaries

bash
bash
rg -U 'first_name\nlast_name' sample.txt
Explanation

Use this for YAML, stack traces, templates, or prose blocks.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Multiline and structured-text searches
Use dotall semantics with PCRE2
Match a block lazily across newlines.
OpenIn sheetbashsame section
Search a YAML block
Look for a key followed later by another key in the same block.
OpenIn sheetbashsame section
Search for nearby JSON keys
Find when two keys appear close together.
OpenIn sheetbashsame section
Search a simple HTML block
Find text between start and end tags.
OpenIn sheetbashsame section
Prefer literal search when possible
Use fixed strings for maximum speed.
OpenIn sheetbash1 tag match
Inspect filtering decisions
Show diagnostics about ignores, globs, and traversal.
OpenIn sheetbash1 tag match