<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[RegEx Search and replace setup]]></title><description><![CDATA[<p dir="auto">I am editing wordpress.sql database file<br />
I remove the WP plugin “Who hit the page”, next<br />
I have to remove in all my pages (800+) the hit function.</p>
<p dir="auto">Syntac is [whohit] variable text length [/whohit] plus carriage return.</p>
<p dir="auto">I use the syntax in search [whohit] +  [/whohit], but don’t work<br />
Can some one help me out?</p>
<p dir="auto">Thx Robert</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/17984/regex-search-and-replace-setup</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 00:13:32 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/17984.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Jul 2019 08:04:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RegEx Search and replace setup on Thu, 25 Jul 2019 13:46:02 GMT]]></title><description><![CDATA[<p dir="auto">Tweak to template due to editing error and not completely checking before posting (did I get it completely right <em>this</em> time? hmmmm):</p>
<pre><code>Bring up the **Find** window (ctrl+f).
Bring up the **Replace** window (ctrl+h).
Bring up the **Find in Files** window (ctrl+shift+f).
Bring up the **Mark** window (*Search* menu &gt; *Mark...*).
**Find what** box: ``
**Replace with** box: ``
**Replace with** box: ***make sure this box is empty!***
**Search mode**: Normal Extended Regular expression
**Backward direction**: unticked
**Match whole word only**: unticked
**Match case**: unticked
**Wrap around**: unticked
**. matches newline**: unticked
**In selection**: unticked
**Bookmark line**: unticked
**Purge for each search**: unticked
Press the **Find Next** button.
Press the **Count** button.
Press the **Find All in All Opened Documents** button.
Press the **Find All in Current Document** button.
Press the **Replace** button.
Press the **Replace All** button.
Press the **Replace All in All Opened Documents** button.
Press the **Find All** button.
Press the **Replace in Files** button.
Press the **Mark All** button.
Press the **Clear all marks** button.```</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/45632</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45632</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 25 Jul 2019 13:46:02 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Wed, 24 Jul 2019 13:58:02 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto">if you are going to provide a Find expression to someone, perhaps someone very noob, also indicate the Search mode right alongside the Find (and/or Replace) expressions</p>
</blockquote>
<p dir="auto">Perhaps a template helps to not forget important details.  The following can be copied and pasted into this forum and then filled-in / deleted-from:</p>
<pre><code>Bring up the **Find** window (ctrl+f).
Bring up the **Replace** window (ctrl+h).
Bring up the **Find in Files** window (ctrl+shift+f).
Bring up the **Mark** window (*Search* menu &gt; *Mark...*).
**Find what** box: ``
**Replace with** box: ``
**Replace with** box: ***make sure this box is empty!***
**Search mode**: Normal Extended Regular expression
**Backward direction**: unticked
**Match whole word only**: unticked
**Match case**: unticked
**Wrap around**: unticked
**. matches newline**: unticked
**In selection**: unticked
**Bookmark line**: unticked
**Purge for each search**: unticked
Press the **Find Next** button.
Press the **Count** button.
Press the **Find All in All Opened Documents** button.
Press the **Find All in Current Document** button.
Press the **Replace** **Replace All** **Replace All in All Opened Documents** button.
Press the **Replace All** button.
Press the **Replace All in All Opened Documents** button.
Press the **Find All** button.
Press the **Replace in Files** button.
Press the **Mark All** button.
Press the **Clear all marks** button.
</code></pre>
<p dir="auto">So the idea is to use the template when composing here (or better, in a scratch N++ tab) is: fill in the blanks, delete out entire lines if they don’t apply or don’t matter, and remove <code>un</code> from <code>unticked</code> if you need to specify <code>ticked</code> for an option.</p>
<p dir="auto">Here’s an example of template usage that (might) be accurate for this thread:</p>
<pre><code>Bring up the **Replace** window (ctrl+h).
**Find what** box: `[whohit .*?/whohit]`
**Replace with** box: ***make sure this box is empty!***
**Search mode**: Regular expression
**Wrap around**: ticked
**. matches newline**: unticked
Press the **Replace All** button.
</code></pre>
<p dir="auto">which produces when posted:</p>
<p dir="auto">Bring up the <strong>Replace</strong> window (ctrl+h).<br />
<strong>Find what</strong> box: <code>[whohit .*?/whohit]</code><br />
<strong>Replace with</strong> box: <em><strong>make sure this box is empty!</strong></em><br />
<strong>Search mode</strong>: Regular expression<br />
<strong>Wrap around</strong>: ticked<br />
<strong>. matches newline</strong>: unticked<br />
Press the <strong>Replace All</strong> button.</p>
<p dir="auto">[Of course, apologies to non-English users of Notepad++…]</p>
<p dir="auto">This is a big <em><strong>FWIW</strong></em> !!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45584</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45584</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Wed, 24 Jul 2019 13:58:02 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 14:07:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/7377">@Alan-Kilborn</a> said:</p>
<blockquote>
<p dir="auto">My experience/testing in this area indicates that Notepad++ will say Find: Invalid regular expression and won’t “fall back” to anything else. This is for [.</p>
</blockquote>
<p dir="auto">You’re right.  I should have tried before I commented.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45568</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45568</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 23 Jul 2019 14:07:29 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 13:45:21 GMT]]></title><description><![CDATA[<p dir="auto">I would not normally reply just to say this, but:  This has been a very hard thread to follow; my head hurts.  But I have other things to add:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14019">@andrecool-68</a> has a bad habit of helping out with searches of this sort without explicitly telling posters to set the Search mode to Regular expression.  Okay, okay…in this case “regex” is in the posting title, but still, if you are going to provide a <code>Find</code> expression to someone, perhaps someone very noob, also indicate the Search mode right alongside the Find (and/or Replace) expressions.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/3841">@PeterJones</a> said:</p>
<blockquote>
<p dir="auto">When you had only [whohit … there was not a pair of brackets, so Notepad++ fell back to treating them as literal characters.</p>
</blockquote>
<p dir="auto">My experience/testing in this area indicates that Notepad++ will say <code>Find: Invalid regular expression</code> and won’t “fall back” to anything else.  This is for <code>[</code>.</p>
<p dir="auto">For <code>]</code> yes, it will be treated literally if there is no opening bracket coming before (as Peter has already correctly said).</p>
<p dir="auto">R van said:</p>
<blockquote>
<p dir="auto">When I search for only “[whohit” I get 747 hits</p>
</blockquote>
<p dir="auto">Are you sure you are in regular expression Search mode when you got this?  Hmmmm…  or probably you aren’t paying attention to detail and giving us exactly what you searched for.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45567</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45567</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 23 Jul 2019 13:45:21 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 13:18:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/15934">@R-van-Wingerden</a> said:</p>
<blockquote>
<p dir="auto">I found my solution by using backslash</p>
</blockquote>
<p dir="auto">Good job.</p>
<blockquote>
<p dir="auto">Only the variable text length (incl, space is) not working<br />
PLS Advice</p>
</blockquote>
<p dir="auto">The reason is because in regular expression mode, the square bracket pair <code>[]</code> defines a character set – so Notepad++ matches any single character found between the square brackets.  When you had only <code>[whohit</code> or only <code>/whohit]</code>, there was not a <em>pair</em> of brackets, so Notepad++ fell back to treating them as literal characters.  By adding the backslash before the first <code>[</code>, you told Notepad++'s regex engine to treat it as a literal <code>[</code>, rather than the start of a pair; and since there was no start to the pair, Notepad++ treated the closing <code>]</code> as a literal as well.</p>
<p dir="auto"><a href="https://notepad-plus-plus.org/community/topic/15765/faq-desk-where-to-find-regex-documentation" rel="nofollow ugc">This FAQ</a> and the documentation it points to (especially the <a href="https://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html" rel="nofollow ugc">Boost regular expression docs</a>) will help you more fully understand regular expressions in general and the Boost regular expression syntax (which is the flavor of regex used in Notepad++) in particular.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45566</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45566</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Tue, 23 Jul 2019 13:18:53 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 10:59:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/15934">@R-van-Wingerden</a> said:<br />
I found my solution by using backslash[whohit(.*)backslash/whohit]<br />
Problem solved<br />
Thx Robert</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45559</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45559</guid><dc:creator><![CDATA[R van Wingerden]]></dc:creator><pubDate>Tue, 23 Jul 2019 10:59:56 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 08:48:45 GMT]]></title><description><![CDATA[<p dir="auto">When I search for only “[whohit”  I get 747 hits<br />
When I search for only “/whohit]”  I get 747 hits<br />
So the search syntax works<br />
Only the variable text length (incl, space is) not working</p>
<p dir="auto">PLS Advice</p>
<p dir="auto">Thx Robert</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45558</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45558</guid><dc:creator><![CDATA[R van Wingerden]]></dc:creator><pubDate>Tue, 23 Jul 2019 08:48:45 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 08:26:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/14019">@andrecool-68</a> said:</p>
<blockquote>
<p dir="auto">[whohit .*?/whohit]<br />
Thx for your replay<br />
It is working result is, 1.582.600 hits to many, many letters ar hit to…</p>
</blockquote>
<p dir="auto">Thx Robert</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45557</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45557</guid><dc:creator><![CDATA[R van Wingerden]]></dc:creator><pubDate>Tue, 23 Jul 2019 08:26:23 GMT</pubDate></item><item><title><![CDATA[Reply to RegEx Search and replace setup on Tue, 23 Jul 2019 08:10:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.notepad-plus-plus.org/uid/15934">@R-van-Wingerden</a><br />
Find and replace<br />
Find : <code>[whohit .*?/whohit]</code><br />
Replace:</p>
]]></description><link>https://community.notepad-plus-plus.org/post/45555</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/45555</guid><dc:creator><![CDATA[andrecool-68]]></dc:creator><pubDate>Tue, 23 Jul 2019 08:10:43 GMT</pubDate></item></channel></rss>