Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Regex Replace

bonghobongho467 downloads

Find and replace text using regular expressions with real-time preview and match highlighting.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

A powerful find and replace plugin for Obsidian that supports regular expressions with real-time preview and match highlighting.

Features

  • Regular Expression Support: Full JavaScript regex syntax including capture groups ($1, $2, etc.)
  • Real-time Preview: See matches highlighted before replacing
  • Match Highlighting: Visual diff showing before/after changes
  • Regex Flags: Toggle global (g), case-insensitive (i), and multiline (m) flags
  • Selection Mode: Replace only within selected text
  • Pattern History: Save and reuse recent search patterns
  • Dark/Light Theme: Optimized for both Obsidian themes

Installation

From Obsidian Community Plugins (Recommended)

  1. Open Obsidian Settings
  2. Go to Community Plugins and disable Restricted Mode
  3. Click Browse and search for "Regex Replace"
  4. Click Install, then Enable

Manual Installation

  1. Download main.js, manifest.json, and styles.css from the latest release
  2. Create a folder: <YourVault>/.obsidian/plugins/regex-replace/
  3. Copy the downloaded files into this folder
  4. Reload Obsidian and enable the plugin in Settings → Community Plugins

Usage

Opening the Replace Dialog

  • Hotkey: Cmd/Ctrl + Shift + H
  • Command Palette: Cmd/Ctrl + P → "Open Regex Replace"

Interface

┌─────────────────────────────────────────────┐
│ Search Pattern:  [Enter regex pattern]      │
│ Replace With:    [Replacement text]         │
│                                             │
│ Flags: ☑ g (global)  ☐ i  ☐ m              │
│ ☐ Replace in selection only                 │
│                                             │
│ 3 match(es) found                           │
│                                             │
│ Before: Hello [world], hello [world]        │  ← Yellow highlight
│ After:  Hello [WORLD], hello [WORLD]        │  ← Green highlight
│                                             │
│ Matches (3):                                │
│ • "world" → "WORLD"                         │
│                                             │
│                    [Replace All] [Cancel]   │
└─────────────────────────────────────────────┘

Regex Examples

Use Case Search Pattern Replace Result
Find numbers \d+ [NUM] abc123 → abc[NUM]
Date format (\d{4})-(\d{2})-(\d{2}) $3/$2/$1 2024-12-08 → 08/12/2024
Remove extra spaces \s+ Multiple spaces → single
Wiki to MD link \[\[(.+?)\]\] [$1]($1.md) [[Note]] → [Note](Note.md)
Header H2 → H3 ^## ### ## Title → ### Title
Remove bold \*\*(.+?)\*\* $1 **bold** → bold
Extract link text \[(.+?)\]\((.+?)\) $1: $2 [text](url) → text: url

Flags

Flag Name Description
g Global Replace all matches (not just the first)
i Ignore Case Case-insensitive matching
m Multiline ^ and $ match line starts/ends

Capture Groups

Use parentheses () to capture groups and reference them with $1, $2, etc.:

Search:  (\w+)@(\w+)\.com
Replace: User: $1, Domain: $2

Input:   [email protected]
Output:  User: test, Domain: example

Settings

Access via Settings → Regex Replace:

Setting Description Default
Default Flags Pre-selected regex flags g
Show Preview Display before/after preview true
History Limit Max saved patterns 10

Development

# Clone the repository
git clone https://github.com/bongho/obsidian-regex-replace.git

# Install dependencies
npm install

# Build for development (watch mode)
npm run dev

# Build for production
npm run build

# Run tests
node test.js

Changelog

1.0.0

  • Initial release
  • Regex find and replace with preview
  • Real-time match highlighting
  • Pattern history
  • Selection-only mode

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

If you find this plugin useful, consider:

  • Starring the repository on GitHub
  • Reporting issues or suggesting features
  • Contributing code improvements

Made with ❤️ for the Obsidian community

80%
HealthExcellent
ReviewSatisfactory
About
Perform search-and-replace using full JavaScript regular expressions with capture groups and regex flags. Preview matches and replacements in real time with before/after highlighting, apply changes to entire notes or selections, and save reusable pattern history.
SearchEditing
Details
Current version
1.0.0
Last updated
6 months ago
Created
6 months ago
Updates
1 release
Downloads
467
Compatible with
Obsidian 0.15.0+
Platforms
Desktop, Mobile
License
0BSD
Report bugRequest featureReport plugin
Author
bonghobongho
github.com/bongho
GitHubbongho
  1. Community
  2. Plugins
  3. Search
  4. Regex Replace

Related plugins

Advanced Tables

Improved table navigation, formatting, and manipulation.

Omnisearch

Intelligent search for your notes, PDFs, and OCR for images.

Smart Connections

AI link discovery copilot. See related notes as you write. Lookup using semantic (vector) search across your vault. Zero-setup local model for embeddings, no API keys, private.

Quick Switcher++

Enhanced Quick Switcher, search open panels, and symbols.

Meta Bind

Make your notes interactive with inline input fields, metadata displays, and buttons.

Outliner

Work with your lists like in Workflowy or Roam Research.

Various Complements

Complete words similar to auto-completion in an IDE.

Creases

Tools for effectively folding Markdown sections.

Simplified Chinese Word Splitting

Adds Simplified Chinese word splitting support for the editor and Vim mode.

LanguageTool Integration

advanced spell/grammar checks with the help of language-tool.