astralyxdev

Regex Tester

Component 4

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>
  );
}

Dependencies

More by astralyxdev

View all
  • Rate Limit Meter

    Rate Limit Meter

    18
  • Note Graph

    Note Graph

    13
  • Prompt Versions

    Prompt Versions

    7
  • Migration List

    Migration List

    7
  • IP Cluster

    IP Cluster

    7
  • Checkout Summary

    Checkout Summary

    7
  • Odds Display

    Odds Display

    5
  • Budget Guard

    Budget Guard

    5