About
A live regex playground that highlights every match in a test string and lists each match's numbered and named capture groups as you type a pattern and flags.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Regex Tester to your project and fits it to your theme.
Code
How Regex Tester is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import RegexTester from "@/components/ui/regex-tester";
import { useState } from "react";
export default function RegexTesterDemo() {
const [pattern, setPattern] = useState("(\\w+)@(\\w+)\\.(\\w+)");
const [flags, setFlags] = useState("g");
const [input, setInput] = useState(
"Contact support@astralyx.dev or sales@example.com for help.\nBackup contact: admin@astralyx.dev",
);
return (
<div className="w-full max-w-xl">
<RegexTester
pattern={pattern}
onPatternChange={setPattern}
flags={flags}
onFlagsChange={setFlags}
input={input}
onInputChange={setInput}
/>
</div>
);
}








