mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3080] [Issue]: Regex import validation rejects valid optional quantifier patterns #1645
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1645
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Jun 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3080
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Regex import validation in
regex-safety.tsappears to reject some valid patterns unnecessarily. In particular, patterns like(a+)?are reported as failing import validation even though their star height should be equivalent to(a+)and allowed by the stated rules.Expected behavior
Patterns such as
(a+)?should import successfully when they do not increase star height beyond the configured limit. Optional quantifiers (?) should not be treated as adding unbounded repetition risk the same way as*,+, or{n,}.Actual behavior
Regex import validation rejects some patterns that use
?after a grouped quantified expression. The Discord report indicatesisQuantifierStart(after)treats?like*and+, causing(a+)?to compute an excessivegroupHeightand fail validation.Steps to reproduce
(a+)?.Environment
Logs, screenshots, or video
Discord attachment included: https://cdn.discordapp.com/attachments/1521376721956241459/1521384830544384161/regex.png?ex=6a44a389&is=6a435209&hm=cc40eb5c983d0ca29551ee9b3502f8f7b3f6244524785739effcb00961e83d88&
Additional context
User identified a likely issue in
regex-safety.tsaround line 131 whereisQuantifierStart(after)returns true for?,*,+, and{. The user notes the code comment on line 16 suggests(a+)should be allowed, but(a+)?is being rejected despite not introducing nested unbounded repetition. Marinara replied that this is addressed on staging.Discord thread: Validation Error bug in regex import
Discord thread link: https://discord.com/channels/1417099416812392641/1521376721956241459
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (3 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 30, 2026):
Fixed in PR #3082: optional ? quantifiers no longer add star height, so patterns like (a+)? import while unsafe nested repetition such as (a+)+ remains rejected. Validation passed: shared lint, pnpm check, prompt regression, and a direct isPatternSafe sanity check.