A powerful, client-side regex testing tool that helps developers, students, and data analysts understand and debug regular expressions with real-time highlighting, capture group visualization, and plain English explanations.
- Real-time Pattern Testing - See matches highlighted instantly as you type
- Capture Group Visualization - Each capture group displayed in distinct colors
- Plain English Explanations - Every regex token explained in human-readable terms
- Flag Controls - Toggle Global (g), Case Insensitive (i), and Multiline (m) flags
- Preset Patterns - Quick access to common patterns (Email, Phone, URL, Date, Password)
- Code Generator - Copy-ready code snippets for JavaScript, Python, and PHP
- Quick Reference Cheat Sheet - Collapsible regex syntax reference
- Responsive Design - Works on desktop, tablet, and mobile devices
- 100% Client-Side - No server required, your data stays private
- Node.js 18+
- npm or yarn
# Clone the repository
git clone https://github.com/techiekamal/regex-visualizer.git
# Navigate to project directory
cd regex-visualizer
# Install dependencies
npm install
# Start development server
npm run devOpen http://localhost:5173 in your browser.
npm run buildThe built files will be in the dist/ directory.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watchregex-visualizer/
├── src/
│ ├── main.ts # Application entry point
│ ├── processor.ts # Regex validation and matching
│ ├── tokenizer.ts # Pattern parsing into tokens
│ ├── explainer.ts # Token explanation generation
│ ├── highlighter.ts # Match highlighting logic
│ ├── codeGenerator.ts # Multi-language code snippets
│ ├── state.ts # Application state management
│ ├── presets.ts # Preset pattern definitions
│ ├── cheatSheet.ts # Quick reference data
│ ├── types.ts # TypeScript interfaces
│ ├── styles.css # Application styles
│ └── ui/ # UI components
│ ├── PatternInput.ts
│ ├── TestArea.ts
│ ├── ExplainerPanel.ts
│ ├── PresetSelector.ts
│ └── CodeGenerator.ts
├── tests/
│ └── property/ # Property-based tests
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
- TypeScript - Type-safe JavaScript
- Vite - Fast build tool and dev server
- Vitest - Unit and property-based testing
- fast-check - Property-based testing library
- Enter pattern:
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Enter test string:
contact@example.com - See the match highlighted and explanation panel updated
- Select "Email Address" from the Presets dropdown
- Pattern and test example are automatically loaded
- Modify as needed for your use case
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
techiekamal
- Instagram: @techiekamal
- GitHub: @techiekamal
- Powered by Codebyart
- Built with ❤️ for developers, students, and data analysts
⭐ Star this repo if you find it helpful!