Repository: vscode
Issue: Regex Find/Replace with named capture groups
Labels: feature-request,editor-find

Type: <b>Bug</b>

The replace field in the tool fails to parse most syntax related to regex substitutions beyond the basic numbered capture groups.  There are several issues opened for closely related problems with find replace that are probably the same issue (incomplete/broken implementation of regex in the replace field) but they're not an exact match.

To Reproduce:
Create a find regex with a named capture group that should match with the find/replace tool bound to ctrl+f.  E.g.:
```
text in file:    beforetextToMatchAndCaptureafter
find:    before(?<myNamedGroup>textToMatchAndCapture)after
replace:    $<myNamedGroup>
expected:    the captured text between the (), literally "textToMatchAndCapture"
actual:    the literal $<myNamedGroup>
```

related: $1 does the substitution correctly.

VS Code version: Code 1.82.0 (8b617bd08fd9e3fc94d14adb8d358b56e3f72314, 2023-09-06T22:07:18.759Z)
OS version: Linux x64 5.10.0-25-amd64
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 9 7950X 16-Core Processor (8 x 4500)|
|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: disabled_software<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: disabled_off|
|Load (avg)|0, 0, 0|
|Memory (System)|7.72GB (4.38GB free)|
|Process Argv|--unity-launch --crash-reporter-id 5d647bc9-1f58-4167-858f-756fddfd1cc1|
|Screen Reader|no|
|VM|0%|
|DESKTOP_SESSION|gnome|
|XDG_CURRENT_DESKTOP|GNOME|
|XDG_SESSION_DESKTOP|gnome|
|XDG_SESSION_TYPE|wayland|
</details><details><summary>Extensions (22)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-markdownlint|Dav|0.52.0
gitlens|eam|14.4.0
terraform-autocomplete|erd|0.0.8
prettier-vscode|esb|10.1.0
copilot|Git|1.126.0
copilot-chat|Git|0.7.1
vscode-pull-request-github|Git|0.72.0
terraform|has|2.28.2
Ionide-fsharp|Ion|7.15.0
TFS|mat|0.0.3
vscode-azureterraform|ms-|0.3.2
csharp|ms-|2.6.24
dotnet-interactive-vscode|ms-|1.0.4461040
vscode-dotnet-pack|ms-|1.0.12
vscode-dotnet-runtime|ms-|1.8.1
jupyter|ms-|2023.8.1002501831
jupyter-keymap|ms-|1.1.2
jupyter-renderers|ms-|1.0.17
vscode-jupyter-cell-tags|ms-|0.1.8
vscode-jupyter-slideshow|ms-|0.1.5
azure-account|ms-|0.11.6
vscode-conventional-commits|viv|1.25.0


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30856252
vscaat:30438848
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
89544117:30613380
a9j8j154:30646983
showlangstatbar:30737416
0bi6i642:30841073
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
copilotsettingt:30859503
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
dsvsc015:30845448
pythonregdiagcf:30859692

```

</details>

<!-- generated by issue reporter -->