Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Regex Workbench

    1

    Build, test, and audit regular expressions for ReDoS risks and cross-language portability.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Regex Workbench

    Regex Workbench

    Example session with this skill installed

    Check this regex for ReDoS risks and explain what it does: ^(a+)+$ Also show how to use it in Go.

    • Read your context and instructions
    • Compiled the regex workbench

    I have analyzed the pattern ^(a+)+$ for performance risks and logic.

    Regex Analysis: ^(a+)+$

    FeatureDetails
    LogicMatches the start of the string, followed by one or more 'a' characters (repeated one or more times), ending at the string boundary.
    ReDoS RiskCRITICAL. This pattern contains nested quantifiers (a+)+. This causes exponential backtracking on strings like aaaaaab, which can hang the process.
    PortabilityUNSUPPORTED IN GO. Go's RE2 engine does not support patterns that could lead to exponential time complexity; however, it specifically lacks support for backreferences and certain lookarounds. While RE2 prevents the crash, the logic itself is flawed for general use.

    Logic Breakdown

    • ^ : Anchor to start of string.
    • (a+)+ : A group matching "a" one or more times, and that entire group is repeated one or more times. This creates overlapping paths for the engine.
    • $ : Anchor to end of string.

    Implementation: Go (RE2)

    package main
    
    import (
    	"fmt"
    	"regexp"
    )
    
    func main() {
    	// Note: RE2 will handle this specific pattern safely but it is logically inefficient.
    	// Recommendation: Simplify to ^a+$ 
    	pattern := `^(a+)+$`
    	re := regexp.MustCompile(pattern)
    	
    	text := "aaaaa"
    	if re.MatchString(text) {
    		fmt.Println("Match found")
    	}
    }
    

    Next steps

    1. Replace ^(a+)+$ with ^a+$ to achieve the same result without the ReDoS vulnerability.
    2. Run the check command on the simplified version to confirm linear time complexity.
    3. Update your Go service with the simplified pattern.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Writing regular expressions by hand is error-prone and notoriously difficult to debug. This skill provides a controlled environment to build, test, and audit patterns for performance and cross-language compatibility.

    What it does

    • Pattern testing runs regex against sample strings to extract matches, capture groups, and named groups.
    • Token explanation breaks down complex patterns into plain English logic for easier auditing.
    • Portability auditing flags syntax errors and behavior differences across Python, JavaScript, PCRE, Java, .NET, Go, and Rust.
    • ReDoS detection identifies catastrophic backtracking risks like nested quantifiers before they hit production.
    • Code generation outputs ready-to-paste implementation blocks for multiple programming languages.

    How it works

    1. Use the test command to verify a pattern against specific text or files.
    2. Run the explain command to get a token-by-token breakdown of how the engine interprets the string.
    3. Invoke check to perform ReDoS heuristic analysis and portability checks for different runtimes.
    4. Execute code to generate the final implementation snippets with appropriate flags.

    Frameworks & tools

    The core engine utilizes Python re for execution. It provides compatibility mapping for JavaScript (V8), PCRE/PHP, Java, .NET, Go (RE2), and Rust.

    Why this beats prompting it yourself

    Generic LLM prompts often ignore engine-specific quirks like Go's lack of lookaheads or Python's Unicode handling for \d. This skill enforces a systematic check for catastrophic backtracking and cross-language syntax errors that simple chat interactions miss.

    Use cases

    • Debugging complex email or URL validation patterns with named capture groups.
    • Porting a PCRE pattern from a legacy PHP app to a Go microservice.
    • Hardening user-input regex against ReDoS attacks in high-traffic APIs.
    • Generating boilerplate code for regex implementation in new projects.

    Known limitations

    Testing is performed using Python's regex engine. Portability flags are advisory and based on known syntax differences rather than live execution in all target environments.

    Testing executes via Python re. Portability checks for Go and Rust are syntax-based. Performance metrics reflect the local environment's CPU.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Requires

    Python

    Permissions

    Terminal / Shell
    Listed1 month ago
    Updated28 days ago

    What's inside

    Frequently Asked Questions

    While the skill executes tests using Python's engine, it performs a static analysis to flag syntax that won't work in engines like Go (which lacks lookaheads) or JavaScript, preventing runtime errors during porting.

    The ReDoS detection tool scans for 'catastrophic backtracking' patterns, such as nested quantifiers, which could allow an attacker to crash your service with a specially crafted string.

    The skill includes the core pattern testing engine, the token breakdown logic, a ReDoS heuristic auditor, and a code generator for seven major programming languages.

    No complex setup is required; once added to your AI agent, you can immediately begin using commands like `test`, `explain`, and `check` via standard text input.

    Yes, the `explain` command translates dense regex syntax into a structured, plain-English breakdown, making it much easier to audit and document legacy patterns.

    New in Testing & Debugging