<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><generator uri="https://gohugo.io/" version="0.101.0">Hugo</generator><title type="html">search on A Scripter's Notes</title><subtitle type="html">Emacs, scripting and anything text oriented.</subtitle><link href="https://scripter.co/categories/search/" rel="alternate" type="text/html" title="HTML"/><link href="https://scripter.co/categories/search/index.xml" rel="alternate" type="application/rss+xml" title="RSS"/><link href="https://scripter.co/categories/search/atom.xml" rel="self" type="application/atom+xml" title="Atom"/><link href="https://scripter.co/categories/search/jf2feed.json" rel="alternate" type="application/jf2feed+json" title="jf2feed"/><updated>2026-04-22T08:24:57-04:00</updated><author><name>Kaushal Modi</name><email>kaushal.modi@gmail.com</email></author><id>https://scripter.co/categories/search/</id><entry><title type="html">Search/replace groups using sed</title><link href="https://scripter.co/search-replace-groups-using-sed/?utm_source=atom_feed" rel="alternate" type="text/html"/><id>https://scripter.co/search-replace-groups-using-sed/</id><published>2014-04-16T14:16:42-04:00</published><updated>2014-04-16T14:16:42-04:00</updated><content type="html"><![CDATA[<p>This is the most common way of my sed usage:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> Good morning <span class="p">|</span> sed <span class="s1">&#39;s/\(.*\s\+\).*/\1evening/g&#39;</span>
</span></span></code></pre></div><p>Here are brief notes on that ..</p>
<p>The above script changes <code>Good morning</code> to <code>Good evening</code>.
Note that the following characters needed the escape character <code>\</code>:</p>
<ul>
<li>Brackets to create regex groups: <code>\(</code> <code>\)</code></li>
<li>Plus sign to match one or more times: <code>\+</code></li>
<li>Note that the <code>.</code> and <code>*</code> characters don&rsquo;t need escaping.</li>
</ul>]]></content><category scheme="https://scripter.co/categories/sed" term="sed" label="sed"/><category scheme="https://scripter.co/categories/regex" term="regex" label="regex"/><category scheme="https://scripter.co/categories/escape" term="escape" label="escape"/><category scheme="https://scripter.co/categories/search" term="search" label="search"/><category scheme="https://scripter.co/categories/replace" term="replace" label="replace"/></entry></feed>