Super Regex

unlisted

by quantavil

Find and replace text using regular expressions and do more.

1 starsUpdated 1mo agoGPL-3.0
View on GitHub

Super Regex

Super Regex is an advanced Find & Replace plugin for Obsidian. It provides a dedicated view pane for performing text replacements across single documents, specific folders, or your entire vault — with full regex support and AI-powered natural language search.

Features

  • AI-Powered Regex ✨: Describe what you want to find in plain English (e.g. "email addresses", "dates in YYYY-MM-DD format"), click the ✨ Convert to RegEx button, and let Google's Gemini API generate the pattern for you automatically.
  • Dual Search Modes: Switch between Text (literal string bounds) and RegEx (full expression support) via a simple pill selector.
  • Flexible Scoping: Search your entire vault, restrict to specific folders via a fuzzy finder, or search within the currently active document.
  • Granular Control: Preview match contexts inline with real-time replacement previews. Check individual matches for bulk actions, or use the inline Apply arrow () to instantly replace a specific match.
  • Safe Undo Mechanism: A prominent Undo banner appears after bulk operations, allowing quick reversal. Protected by a history cap.
  • Export Matches: Copy all grep-style match results (file:line:col: text) to clipboard.
  • Plaintext Pipe Matching: Separate multiple words using pipes (|) in Text mode to track which terms were "Not Found".
  • Keyboard Friendly: Ctrl/Cmd+Enter to search, Ctrl/Cmd+Shift+Enter to replace.

Installation

Via BRAT (Recommended)

  1. Install the Obsidian42 - BRAT plugin from the Obsidian Community Plugins catalog and enable it.
  2. Go to Settings → BRAT.
  3. Click Add Beta plugin.
  4. Enter the repository path: quantavil/super-regex.
  5. The plugin will be downloaded automatically. Go to Settings → Community plugins and enable Super Regex.

How to Use

  1. Click the Search icon in the left ribbon or invoke Open Find and Replace panel.
  2. Select your Mode using the pills — Text or RegEx.
  3. Enter your query in the Find input:
    • Text mode: Enter standard text values.
    • RegEx mode: Type your regex, OR write plain English and click the ✨ Convert to RegEx button.
  4. Toggle All Files and click 📁 All to restrict to a folder if needed.
  5. Define the replacement string in the Replace input.
  6. Review inline match previews in the results pane.
  7. Hit Replace Checked to execute bulk changes, or use the arrow on individual matches for quick inline replacements.
  8. Made a mistake? Click Undo on the banner or use the Undo button/command. Focus automatically returns to the search input.

Common Use Cases

Super Regex can help automate tedious text processing tasks. Here are a few examples:

  • Removing unintended blank lines: Switch to RegEx mode, search for ^\s*[\r\n]+, and leave the replace field empty to clean up excessive spacing.
  • Updating date formats: Click the button and type "dates in MM/DD/YYYY format" to quickly find and standardize dates across your vault.
  • Fixing Markdown links: Convert raw URLs to proper Markdown links or update wiki-links in bulk across a specific folder.
  • Removing trailing whitespace: Find \s+$ in RegEx mode and replace with nothing to quickly clean up messy line endings.
  • Typography standardization: Bulk replace straight quotes ("...") with curly quotes (“…”) or fix repetitive textual errors.

AI Setup

  1. Go to Settings → Super Regex → AI Configuration.
  2. Enter your API Key (Google Gemini API key).
  3. The default model is gemma-4-31b-it and the default endpoint is Google's OpenAI-compatible API. You can change both to use any OpenAI-compatible provider.
  4. Click Verify API Configuration to test your connection.

Author

Quantavil

Version

1.2.0

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0) - see the LICENSE file for details.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.