Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>(This answer is outdated and does not fully answer the question as presently asked. However, it is retained here rather than deleted on the advice of another answerer.)</p> <p>If you want a regex that cannot be fooled, why, that will take some work. While using Vim, though, one usually takes a more relaxed attitude. Does this not serve?</p> <pre><code>:s/"final time"/"final_time"/g </code></pre> <p>You can omit the trailing <code>g</code> if you want replacement to occur only once. On the other hand, you can make it</p> <pre><code>:s/"\cfinal time"/"final_time"/g </code></pre> <p>to make the pattern-match case-insensitive (though, really to do this right, see @Tomalak's answer).</p> <p>However, while using Vim, there may be an easier way, as follows.</p> <ol> <li>Press <code>qq</code> to start recording Macro <code>q</code> (or <code>qa</code> to start recording Macro <code>a</code>, etc., as you prefer; if unsure, <code>qq</code> is quickest to type and as good as any other).</li> <li>Type the search command <code>/"\cfinal time"</code> and press enter.</li> <li>Press <code>f&lt;Space&gt;</code> or <code>6l</code> to move the cursor over to the space.</li> <li>Press <code>r_</code> to replace the space with an underscore.</li> <li>Press <code>q</code> to finish recording the macro.</li> </ol> <p>Then, if you like, you can immediately press <code>@q</code> to make Vim repeat the same operations automatically. This is quick, and useful, if you have several strings <code>"final time"</code> scattered throughout your file that all want the same edit. Even better, the <em>third</em> and subsequent time you want Vim to do the same operations, you can just press <code>@@</code> to repeat the last <code>@</code> operation. This is extra quick.</p> <p>(Thanks to @Tomalak for adding that <code>/"\cfinal time"</code> modifies the search to be case-insensitive. I had not known that.)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload