Regex Examples and Cookbook/Extract fenced code block

Match a markdown fenced code block.

Section: Extraction Recipes

Extract fenced code block

regex
regex
```(\w+)?\n[\s\S]*?\n```
Explanation

Common when cleaning or indexing markdown content.

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 Extraction Recipes
Extract markdown links
Capture label and URL from markdown links.
OpenIn sheetregexsame section
Extract URLs
Find basic HTTP or HTTPS URLs.
OpenIn sheetregexsame section
Extract emails
Find email-like tokens in text.
OpenIn sheetregexsame section
Capture a simple CSV field
Extract a non-quoted CSV field token.
OpenIn sheetregexsame section
Extract log level
Capture common log levels from log lines.
OpenIn sheetregexsame section
UUID shape
Match a standard hyphenated UUID.