Repository: vscode
Issue: Find stops working on extremely long input ("Invalid regular expression" warning thrown)
Labels: polish,editor-find

Type: <b>Bug</b>

Create an extremely long string, something like 150,000+ characters. Open Find and paste in the string. After this, whenever Ctrl+F is pressed or the "Find" menu item is chosen, the warning "Invalid regular expression" is shown and the Find tool is not focused like it usually is when already open.

It might not be practical to search for an extremely long input like this, but I had it on my clipboard, and somehow I pasted it into Find. When I pressed Ctrl+F to focus Find again, it didn't work, so that was a bit annoying.

My two cents: I'm guessing Code uses RegEx to find the search string in the editor, and this error is likely being thrown because of a maximum input length limit on RegEx strings.

VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i9-9960X CPU @ 3.10GHz (32 x 3096)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|31.69GB (10.35GB free)|
|Process Argv|--crash-reporter-id f587ddf7-21bf-4443-a86e-3345e7cf2f08|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (36)</summary>

Extension|Author (truncated)|Version
---|---|---
Bookmarks|ale|13.3.1
aws-toolkit-vscode|ama|1.74.0
atlascode|atl|3.0.3
calva|bet|2.0.363
calva-spritz|bet|1.0.4
doxdocgen|csc|1.4.0
vscode-eslint|dba|2.4.0
portal|djb|0.40.0
auto-rename-tag|for|0.1.10
vscode-pull-request-github|Git|0.64.0
better-cpp-syntax|jef|1.17.2
cmake-language-support-vscode|jos|0.0.9
prettify-json|moh|0.0.3
csharp|ms-|1.25.7
vscode-dotnet-runtime|ms-|1.6.0
isort|ms-|2022.8.0
python|ms-|2023.8.0
vscode-pylance|ms-|2023.5.40
remote-containers|ms-|0.292.0
remote-ssh|ms-|0.102.0
remote-ssh-edit|ms-|0.86.0
remote-wsl|ms-|0.78.7
cmake-tools|ms-|1.14.31
cpptools|ms-|1.15.4
cpptools-extension-pack|ms-|1.3.0
hexeditor|ms-|1.9.11
powershell|ms-|2023.5.0
remote-explorer|ms-|0.4.0
vscode-serial-monitor|ms-|0.9.0
vscode-react-native|msj|1.11.0
vscode-thunder-client|ran|2.7.3
vscode-yaml|red|1.13.0
cmake|twx|0.0.17
vscode-arduino|vsc|0.6.0
change-case|wma|1.0.0
markdown-all-in-one|yzh|3.5.1

(1 theme extensions excluded)

</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaac:30438847
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
a9j8j154:30646983
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
pythonfmttext:30731395
fixhidewlkth:30730051
pythongtdpath:30739704

```

</details>

<!-- generated by issue reporter -->