Runaway regex searches crash cursor

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Runaway regex search patterns, f.x. catastrophical backtracks, crashes the IDE.
Solution example: regex101.com gracefully validates and breaks execution.

Steps to Reproduce

  1. Create a file with (exactly):
{ test
                                                                                                   },
  1. Search all: \{([\s\S]|[^;])+test with regex (.*) enabled.

Expected Behavior

Gracefully report something like: "Catastrophic backtracking has been detected and the execution of your expression has been halted. "

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.4.7 (Universal)
VSCode Version: 1.105.1
Commit: ca0f9bf806f235ea014a22712cbcbf5e88ca77e0
Date: 2026-01-20T20:52:38.077Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Note: The same regex can be seen on regex101.com here: regex101: build, test, and debug regex

Hey, thanks for the report. It’s well structured and has clear repro steps.

This is a valid issue. VS Code, and Cursor by extension, doesn’t guard against expensive regex patterns in Search. Your catastrophic backtracking example really should time out instead of crashing the IDE.

I’ve shared this with the team along with your repro steps and the regex101 link. For now there’s no workaround other than avoiding those patterns.

Let me know if you hit this in real work, not just a test case. That’ll help us gauge priority.

1 Like

Glad to help. Yea I hit it with real work. While structuring a valid search pattern I hit a catastrophic backtrack and crashed the IDE mid work. Didn’t lose any work though.

1 Like