---
title: "Support regex substitution command · Issue #2232 · helix-edito..."
description: "!https://github.com/helix-editor/helix/issues/2232#issuecomment-1228632218"
date: 2024-10-08
published: true
tags:
  - refactoring
  - regex
  - thought
  - vim
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://github.com/helix-editor/helix/issues/2232#issuecomment-1228632218" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://opengraph.githubassets.com/6070a27597ac258b977bcb6e14aad6075dc9a5bba312a6b515fc74353a5b7731/helix-editor/helix/issues/2232" alt="Support regex substitution command  · Issue #2232 · helix-editor/helix — Support regex substitution, comparable to vim :s or VSCode search &amp; replace. I propose supporting regex replacements for selection s, files/, and the workspace scopes &lt;space&gt; + /. This could be acc..." loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">Support regex substitution command  · Issue #2232 · helix-editor/helix</div>
      <div class="embed-card-description">Support regex substitution, comparable to vim :s or VSCode search &amp; replace. I propose supporting regex replacements for selection s, files/, and the workspace scopes &lt;space&gt; + /. This could be acc...</div>
      <div class="embed-card-meta">GitHub &middot; github.com</div>
    </div>
  </a>
</div>


Here is a really good vim substitute with regex capture groups, saving this one for a rainy day.


``` md
* Reading 1: This is a title to a link
* Reading 2: This is another title
```

`:%s/\v(: )(.+)$/\1\[\2\]\(`

``` md
* Reading 1: [This is a title to a link](
* Reading 2: [This is another title](
```
