Skip to content

[Needs confirmation][Tool #43] Regex Generator silently accepts Min greater than Max #380

Description

@baixiangcpp

Summary

Regex Generator accepts an invalid length range where Min is greater than Max. It reports successful generation, silently ignores the entered Max value, and produces a fixed-length pattern based only on Min.

Affected tool: Regex Generator
Route: https://byteflow.tools/en/regex-generator
Status: Needs product confirmation, but the behavior was reproduced during browser acceptance.
Observed: 2026-08-18

Reproduction

  1. Open the affected route.
  2. Select the Custom char class preset.
  3. Set the custom character class to:
A-F0-9
  1. Set Min to 5.
  2. Set Max to 3.
  3. Enter sample text:
AB12
  1. Click Generate.

Actual output

The page reports:

Generate completed.

It generates the exact-length pattern:

^[A-F0-9]{5}$

The entered Max value of 3 is not represented in the generated pattern, and no validation error explains that Min cannot exceed Max.

Expected output

The UI should reject or clearly validate Min=5 and Max=3, for example:

Invalid range: Min must be less than or equal to Max.

It should not report successful generation or silently change the requested range. If the product intentionally normalizes the values, the normalized values must be visible and the output must be documented.

Impact

Users may believe the generated regex enforces a 3–5 character range when it actually enforces exactly 5 characters.

Regression coverage

Test Min/Max pairs 3/5, 5/5, 5/3, empty values, and boundary values. Assert that invalid ranges cannot produce a successful regex without an explicit validation result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions