No description
.gitignore | ||
go.mod | ||
go.sum | ||
main.go | ||
makefile | ||
README.md |
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
- Run the application:
./regex-tui
- Start in NORMAL mode (text input folded to save space)
- Press
i
to enter INSERT mode for editing (expands input area) - Use vim-like keys to navigate and control
- Toggle sed mode with
s
for replacement operations - The interface automatically adjusts to your terminal size
- Press
d
then a number to delete patterns - See live feedback in the display area
- Resize terminal to at least 60x15 for best experience
Controls
Normal Mode
i
/I
: Enter insert mode at cursor / enda
/A
: Enter insert mode after cursor / endTab
/j
/k
: Switch between text and regex panes1-9
: Select and load pattern 1-9 into input fieldd
: Enter delete mode, then press 1-9 to delete patterns
: Toggle sed modec
: Clear text inputy
: Copy current regex to clipboardEnter
: Add current regex as new patternCtrl+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