TReX is a terminal-based tool for writing, visualizing, and testing Regular Expressions. Designed for efficiency, it provides a keyboard-driven interface for rapid feedback on your regex experiments—all within your terminal.
Sometimes you just want to quickly test out a regex without switching between multiple browser tabs or online tools. TReX lets you see how your regex interacts with your text in real time—all within your terminal.
- Quick feedback: Validate and debug regex patterns instantly.
- Integrated testing: Load files and experiment with regex combinations.
- Efficient workflow: Stay in your terminal and keep your focus on writing code.
TReX, is a playful fusion of TUI and RegEx.
The T
comes from TUI, while ReX
from RegEx, hence TReX.
:t-rex: roar!
- Written in Go: Fast and portable.
- External file loading: Test regex patterns against real-world data.
- Keyboard-driven interface: Navigate without the need for a mouse.
- Mouse support: For users who prefer it or need it.
-
Install from Go Package Reference:
go install github.com/samyakbardiya/trex@latest
OR from the source
-
Clone the repository:
git clone https://github.com/samyakbardiya/trex.git cd trex
-
Build the application:
go install go build
-
Optionally, you can copy the binary to your
PATH
:cp ./trex ~/.local/bin
-
-
Verify the installation:
./trex --version
-
Start TReX:
trex
-
Load a file into TReX:
trex file.txt
-
Advanced usage: Check out the help flag for more commands:
trex --help
- Editable Text Area: Replace the read-only view with an editable interface.
- Local History: Implement local history similar to shell history, navigable with arrow keys.
- Syntax Highlighting: Add syntax highlighting for the RegEx input.
- Toggleable Flags: Implement quick toggling for RegEx flags, such as:
g
(global)m
(multi-line)i
(case-insensitive)U
(ungreedy)
Contributions are welcome! Feel free to open issues or submit pull requests. For major changes, please open an issue first to discuss what you'd like to change.
Developed in Go, TReX leverages:
- Bubble Tea for building the TUI.
- Cobra for command-line functionality.
- Lip Gloss for styling.
- Bubbles for additional utilities
Made during FOSS HACK 2025 in India 🇮🇳