No description
Find a file
2025-10-03 11:36:19 +02:00
.gitignore Added regex-tui to the .gitignore 2025-10-03 11:29:57 +02:00
go.mod Initial commit 2025-10-03 11:29:07 +02:00
go.sum Initial commit 2025-10-03 11:29:07 +02:00
main.go Initial commit 2025-10-03 11:29:07 +02:00
makefile wip 2025-10-03 11:36:19 +02:00
README.md Initial commit 2025-10-03 11:29:07 +02:00

Regex TUI

A terminal-based application for learning and testing regular expressions with vim-like interface.

Features

  • Interactive text input area for your test strings (folds in normal mode to save space)
  • Live regex pattern matching with color highlighting
  • Real-time highlighting while typing regex or sed commands
  • Multiple regex patterns with easy switching, editing, and deletion
  • Sed syntax simulation for replacements
  • Vim-like normal/insert modes with pane indicators
  • Dynamic terminal resizing with minimum size requirements
  • Clipboard integration for copying regex patterns
  • Error feedback for invalid regex/sed syntax
  • Dark theme for better contrast
  • Formatted help display for easy reading
  • Intuitive keyboard navigation

Usage

  1. Run the application: ./regex-tui
  2. Start in NORMAL mode (text input folded to save space)
  3. Press i to enter INSERT mode for editing (expands input area)
  4. Use vim-like keys to navigate and control
  5. Toggle sed mode with s for replacement operations
  6. The interface automatically adjusts to your terminal size
  7. Press d then a number to delete patterns
  8. See live feedback in the display area
  9. Resize terminal to at least 60x15 for best experience

Controls

Normal Mode

  • i / I: Enter insert mode at cursor / end
  • a / A: Enter insert mode after cursor / end
  • Tab / j / k: Switch between text and regex panes
  • 1-9: Select and load pattern 1-9 into input field
  • d: Enter delete mode, then press 1-9 to delete pattern
  • s: Toggle sed mode
  • c: Clear text input
  • y: Copy current regex to clipboard
  • Enter: Add current regex as new pattern
  • Ctrl+C / q: Quit

Insert Mode

  • Type to edit text or regex
  • Esc: Return to normal mode

Sed Mode

When sed mode is active, the regex input expects sed commands like s/pattern/replace/g. The display shows the result of applying the sed operation to the text.

Building

go build

Dependencies