Skip to content

Regex optional groups crash#2077

Open
FF-Brown wants to merge 2 commits into
recurser:mainfrom
FF-Brown:regex-optional-groups-crash
Open

Regex optional groups crash#2077
FF-Brown wants to merge 2 commits into
recurser:mainfrom
FF-Brown:regex-optional-groups-crash

Conversation

@FF-Brown

Copy link
Copy Markdown

When an optional group was not present in the test string, 'group' was null and caused an exception to be thrown. Now we fall back to an empty string instead.

image

How to test the PR

  1. Open the regex debugger
  2. Enter the pattern Hello(World)?$ in Box 1 (as suggested in issue Regex - Optional Capture Group #2002 )
  3. Enter the string Hello in Box 2
  4. No error is thrown, the string is shown to be a match, and the captured group is displayed
  5. Additionally, it works with the test string HelloWorld

Checklist

  • [ x ] New functionality has tests.
  • [ x ] README has been updated (if necessary). (N/A)
  • [ x ] New environment variables have been added to .env.example (if necessary). (N/A)

@FF-Brown FF-Brown requested a review from recurser as a code owner May 29, 2026 20:26
@vercel

vercel Bot commented May 29, 2026

Copy link
Copy Markdown

@FF-Brown is attempting to deploy a commit to the Dave Perrett's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant