Offline Windows tool for finding context around keyword or regex matches in local documents.
The app searches a document, expands a smart context block around every hit, previews the result safely, and exports the matches to DOCX, Markdown, or TXT.
Repository: https://github.com/maxliebscher/DocumentContextExtractor
Click any screenshot to open it full-size.
| General workflow | Dark Violet writing | Soft Slate writing |
|---|---|---|
- Runs locally on Windows; no browser or cloud account required
- Input formats:
- Word
.docx - Markdown
.md,.markdown - Plain text
.txt - HTML
.html,.htm - Rich Text
.rtfwith basic text extraction
- Word
- Regex or plain keyword search
- Optional case-sensitive matching
- Smart context expansion:
- starts one paragraph before and after a hit
- expands up and down until a blank paragraph or a
#heading - optional min/max word guards, matching the original extraction behavior
- Safe preview:
- starts with the first matches only
- More matches expands in chunks
- All matches shows as much as the preview safety limit allows
- optional match highlighting in the preview, on by default
- export always includes all matches
- Larger default window with a taller preview area
- DPI-aware Windows Forms layout with scrolling fallback for smaller screens
- Tooltips for the less obvious controls
- Language selection:
- German when the system language is German
- English otherwise
- manual switch in the header
- Local-only About dialog:
- no cloud uploads
- no telemetry
- no user accounts
- Export formats:
- Word
.docx - Markdown
.md - Plain text
.txt
- Word
- UI themes:
- Calm Burgundy
- Dark Violet
- Soft Slate
- Burgundy app icon based on a highlighted excerpt/document motif
-
Download the latest Windows ZIP from the GitHub release page.
-
Unzip it and start
DocumentContextExtractor.exe. -
Drop a source file onto the window or choose Browse.
-
Enter a keyword or regex, for example:
contract|deadline|meeting -
Choose smart context, length, case, export format, language, and theme.
-
Click Show preview or Extract and save.
The same executable can also run without the UI:
.\DocumentContextExtractor.exe --input manuscript.docx --keyword "contract|deadline" --output extract.mdOptions:
--smart true|false
--min NUMBER
--max NUMBER
--ignore-length
--case-sensitive
Document Context Extractor runs locally. It does not upload documents, use telemetry, or require a cloud account.
End users do not need the .NET SDK when using a self-contained release build. Developers need Windows and the .NET 8 SDK with Windows Desktop support.
Build from source:
dotnet build .\DocumentContextExtractor.csprojCreate a self-contained Windows x64 release build:
dotnet publish .\DocumentContextExtractor.csproj -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true /p:EnableCompressionInSingleFile=trueMIT