NAME
trex — A Terminal app for RegEx visualization, :t-rex: roar!
SYNOPSIS
go install github.com/samyakbardiya/trex@latestINFO
DESCRIPTION
A Terminal app for RegEx visualization, :t-rex: roar!
README
TReX :t-rex:
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.
Why TReX?
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.
Okay, but why "TReX"?
TReX, is a playful fusion of TUI and RegEx. The T comes from TUI,
while ReX from RegEx, hence TReX :t-rex:. Roar!
Features
- 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.
Installation
Install from Go Package Reference:
go install github.com/samyakbardiya/trex@latest
OR from the source
From the source
Clone the repository:
git clone https://github.com/samyakbardiya/trex.git cd trexBuild the application:
go install go buildOptionally, you can copy the binary to your
PATH:cp ./trex ~/.local/bin
Verify the installation:
./trex --version
Usage
Start TReX:
trexLoad a file into TReX:
trex file.txtAdvanced usage: Check out the help flag for more commands:
trex --help
Roadmap
- 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)
Contributing
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.
Implementation
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 :india:
