<?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[sample config]]></title><description><![CDATA[<p dir="auto">Re: <a href="/topic/20939/find-config-files-that-do-not-contain-username-and-password">find config files that do not contain username and password</a></p>
<p dir="auto">service nagle<br />
no service pad<br />
service timestamps debug datetime localtime<br />
service timestamps log datetime localtime<br />
service password-encryption<br />
logging buffered 15000<br />
logging console critical<br />
logging monitor warnings<br />
enable secret 0 cisco<br />
username admin password cisco<br />
^<br />
line con 0<br />
line vty 0 4<br />
exec-timeout 30 0<br />
privilege level 15<br />
transport preferred ssh<br />
transport input ssh<br />
transport output ssh<br />
line vty 5 15<br />
exec-timeout 30 0<br />
privilege level 15<br />
transport preferred ssh<br />
transport input ssh<br />
transport output ssh<br />
ntp source Loopback0<br />
ntp server 10.1.0.6<br />
ntp server 10.1.0.7<br />
ntp server 10.1.0.8 prefer<br />
port-channel load-balance src-dst-ip</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20940/sample-config</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 05:44:15 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20940.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Mar 2021 16:39:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to sample config on Sat, 27 Mar 2021 12:14:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/64425">sample config</a>:</p>
<blockquote>
<p dir="auto">After ticking this option, in the Preferences dialog and closing N++, the value of the dlgAlwaysVisible attribute is still no in the config.xml file !</p>
</blockquote>
<p dir="auto">Hmm. I would think that <code>dlgAlwaysVisible</code> would get erased from the <code>FindHistory</code> section at the N++ release that moves control to the <code>Searching</code> section of config.xml; example of that:</p>
<pre><code class="language-z">&lt;GUIConfig name="Searching" monospacedFontFindDlg="yes" stopFillingFindField="no" findDlgAlwaysVisible="yes" confirmReplaceInAllOpenDocs="yes" /&gt;
</code></pre>
<p dir="auto">Notice the name is now slightly different, too:  <code>findDlgAlwaysVisible</code></p>
<p dir="auto">But…I really don’t know how such “obsolete” items are handled.</p>
<blockquote>
<p dir="auto">So , no need to create any issue</p>
</blockquote>
<p dir="auto">If obsolete settings are supposed to be removed, maybe <em><strong>THAT’S</strong></em> an issue you could open!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64426</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64426</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 27 Mar 2021 12:14:13 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Sat, 27 Mar 2021 11:18:19 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">How <strong>silly</strong> am I !! I did not notice that this <strong>old</strong> setting has been adding in the <strong><code>Preferences</code></strong> dialog. <strong>Nice</strong> ! So , no need to create any issue : good ;-)) This also explains why this <strong>pseudo</strong>-issue begins with the <strong><code>v7.9.0</code></strong> issue !</p>
<p dir="auto">After <strong>ticking</strong> this option, in the <strong><code>Preferences</code></strong> dialog and <strong>closing</strong> N++, the value of the <strong><code>dlgAlwaysVisible</code></strong> attribute is <strong>still</strong> <strong><code>no</code></strong> in the <strong><code>config.xml</code></strong> file !</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64425</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64425</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Sat, 27 Mar 2021 11:18:19 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Sat, 27 Mar 2021 11:03:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a></p>
<blockquote>
<p dir="auto">When doing all my tests, I wanted to keep the “Find in Files” dialog opened, after each click on the Find All button ! So, I changed, in the &lt;FindHistory •••••••• &gt; section of the config.xml file, the value of the dlgAlwaysVisible attribute from no to yes</p>
</blockquote>
<p dir="auto">Maybe what you are trying to do manually is conflicting with this setting?:</p>
<p dir="auto"><img src="/assets/uploads/files/1616842907786-2987c38a-5e94-4097-a8f9-d18f0d69695c-image.png" alt="2987c38a-5e94-4097-a8f9-d18f0d69695c-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">EDIT: I have no idea why my screenshot is twice as big vertically as intended! :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64424</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64424</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 27 Mar 2021 11:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 15 Apr 2021 09:50:05 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: justin-lang">@<bdi>justin-lang</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">To <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> <strong>only</strong> :</p>
<p dir="auto">Let’s back to your <strong>first</strong> regex version <strong><code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code></strong>. This regex look for a <strong>continuous</strong> range of lines, <strong>not</strong> followed with an <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong>, between the <strong>very beginning</strong> and the <strong>very end</strong> of current file. In this case a <strong>match</strong> occurs and this file is <strong>displayed</strong> in the <strong><code>Search results</code></strong> window</p>
<p dir="auto">But, if so, in order to <strong>match</strong> the <strong><code>\z</code></strong> assertion, as the <strong>last</strong> line of current file may <strong>not end</strong> with <strong>EOL</strong> chars, this <strong>first</strong> version should be <strong><code>(?i-s)\A(^.*\R?(?!^username \S+ password \S+$))+\z</code></strong> with a question mark <strong><code>?</code></strong> after <strong><code>\R</code></strong> ?</p>
<p dir="auto">And, indeed, this <strong>first modified</strong> version does <strong>work</strong> on my machine, with the <strong>additional</strong> results already known when the <strong><code>username •••• password ••••</code></strong> is the <strong>first</strong> line of current file</p>
<p dir="auto">Well, <strong>end</strong> of the story regarding this <strong>bugged</strong> version, anyway !!</p>
<hr />
<p dir="auto">To <strong>All</strong> :</p>
<p dir="auto">I <strong>improved</strong> my own version to :</p>
<p dir="auto">SEARCH <strong><code>\A(?s)(?:.*?(?i)^username \S+ password \S+$(*SKIP)(*F)|)</code></strong></p>
<p dir="auto">As you can see :</p>
<ul>
<li>
<p dir="auto">The regex now uses a <strong>non-capturing</strong> group ( could be interesting if file of <strong>big</strong> size or with <strong>long</strong> lines ! )</p>
</li>
<li>
<p dir="auto">It searches for the <strong>smallest</strong> range of chars till a <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong></p>
</li>
<li>
<p dir="auto">In case of <strong>no</strong> line <strong><code>username •••• password ••••</code></strong> exists, in current file, the <strong>second</strong> <em>empty</em> alternative simply searches the <strong><code>\A</code></strong> <strong>position</strong>, which is the <strong>very beginning</strong> location of <strong>current</strong> scanned file !</p>
</li>
</ul>
<hr />
<p dir="auto">Now, here is an  <strong>off-topic</strong> subject :</p>
<p dir="auto">When doing all my <strong>tests</strong>, I wanted to keep the “<strong>Find in Files</strong>” dialog <strong>opened</strong>, after each click on the <strong><code>Find All</code></strong> button ! So, I changed, in the <strong><code>&lt;FindHistory •••••••• &gt;</code></strong> section of the <strong><code>config.xml</code></strong> file, the value of the <strong><code>dlgAlwaysVisible</code></strong> attribute from <strong><code>no</code></strong> to <strong><code>yes</code></strong></p>
<p dir="auto">However, after <strong>re</strong>-starting N++, <strong>no</strong> luck : the “<strong>Find in Files</strong>” dialog was still <strong>closed</strong> after running a search :-(( I verified that this <strong>wrong</strong> behavior occurs since the <strong><code>v7.9.0</code></strong> release !</p>
<p dir="auto">Could you <strong>confirm</strong> me that fact, with the new <strong><code>Non-XP</code></strong> releases ? In case of <strong>positive</strong> answer(s), I will create an <strong>issue</strong>, on <strong>GitHub</strong> !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64421</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64421</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 15 Apr 2021 09:50:05 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 19:52:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> thanks so much.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64408</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64408</guid><dc:creator><![CDATA[Justin Lang]]></dc:creator><pubDate>Fri, 26 Mar 2021 19:52:54 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 19:25:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> ,</p>
<blockquote>
<p dir="auto">which regex online tester that support .NET regex ?</p>
</blockquote>
<p dir="auto">The <a href="/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a> has links to external regex testers.  One or more of them may support .NET regex, but I don’t know off the top of my head.  Notepad++ uses the Boost regex engine (which is a variant of PCRE), not .NET regex.  Since this forum is focused on discussing Notepad++, not supporting and answering questions on all flavors of regex, so if you have .NET regex specific questions, here is not the right place for them.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64407</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64407</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 26 Mar 2021 19:25:44 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 19:05:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> thank you for your advice.  I will continue try and learn regex.  There is some regex tester online, but each of them support its own flavor of regex.  Do you know which regex online tester that support .NET regex ? thanks</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64406</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64406</guid><dc:creator><![CDATA[Justin Lang]]></dc:creator><pubDate>Fri, 26 Mar 2021 19:05:53 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 19:00:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> thank you so much for providing well explainnation of the regex. I am learning how to use it to match pattern in the network configuration files.  Regex is very interesting and useful to quickly find matches in the file but very confusion too.  Thanks for your help.  I will continue to rely on your help as I am learning regex if you don’t mind.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64405</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64405</guid><dc:creator><![CDATA[Justin Lang]]></dc:creator><pubDate>Fri, 26 Mar 2021 19:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 17:06:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/64398">sample config</a>:</p>
<blockquote>
<p dir="auto">As you can see, I put a $ assertion at the end of the negative look-ahead,</p>
</blockquote>
<p dir="auto">Yes, that definitely makes more sense, from the logical/algorithmic standpoint.  <a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> should use that variant if using my “family” of regex at all.   Of course, this all assumes that the original assumptions I made, based on just one piece of example text, is sufficient to thoroughly describe the exact rules.  The OP has never confirmed whether spaces are allowed before or after, or whether it should match or not match in the weird situations like text before and/or after on the same line, or not.  So at this point, I think I’ve done enough for this question from the OP.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64400</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64400</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 26 Mar 2021 17:06:59 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 16:36:05 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>,</p>
<p dir="auto">I did some other tests and there’s <strong>definitively</strong> something <strong>strange</strong> with your <strong>first</strong> regex version. Like you, I got a <strong>positive</strong> result, just <strong>once</strong> and some <strong>subsequent</strong> tests did <strong>not</strong> find anything !!! Right now, I’m still <strong>unable</strong> to see the <strong>right</strong> point and I’m still investigating :-((</p>
<hr />
<p dir="auto">Now, regarding your <strong>second</strong> version, sorry, but I’ve found out an <strong>issue</strong> when a <strong>correct</strong> line <strong><code>username •••• password ••••</code></strong> <strong>begins</strong> a line and is <strong>followed</strong> with some characters, as in the <strong><code>G8.txt</code></strong> file, below :</p>
<pre><code class="language-diff">usexrname admin pasxsword cisco
username blah password blah 67890
some other text
</code></pre>
<hr />
<p dir="auto">With your <strong>second</strong> regex version <strong><code>(?i-s)\A(^(?!username \S+ password \S+).*$\R*)+\z</code></strong>, the <strong><code>G8.txt</code></strong> file is <strong>not</strong> listed in the <strong><code>Search results</code></strong> panel, as it should be !</p>
<p dir="auto">If I <strong>slightly</strong> change your regex as <strong><code>(?i-s)\A(^(?!username \S+ password \S+$).*\R?)+\z</code></strong>, this time, the <strong><code>G8.txt</code></strong> file is <strong>correctly</strong> part of the list</p>
<p dir="auto">As you can see, I put a <strong><code>$</code></strong> assertion at the <strong>end</strong> of the <strong>negative</strong> look-ahead, deleted this <strong>same</strong> assertion <strong>previously</strong> located before <strong><code>\R*</code></strong>, which I also modified as <strong><code>\R?</code></strong> as any line has <strong>EOL</strong> chars, only <strong>once</strong> or possibly <strong>not</strong> in case of the <strong>last</strong> line of the file !</p>
<p dir="auto">The path is <strong>difficult</strong> but we will get there !</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64398</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64398</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 26 Mar 2021 16:36:05 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 14:50:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a>,</p>
<p dir="auto">Sorry, we got into the weeds.  In case it’s not clear to you:  <strong>Don’t use my first regex</strong>; there are too many problems with it.</p>
<p dir="auto">Instead, use my second, which works more reliably: <code>(?i-s)\A(^(?!username \S+ password \S+).*$\R*)+\z</code>.</p>
<p dir="auto">Also, the <code>\A</code> syntax won’t work correctly if you are using a Notepad++ older than v7.9.1, so make sure you have a recent Notepad++.  v7.9.1 was the last to have <a href="https://notepad-plus-plus.org/update/getDownloadUrl.php" rel="nofollow ugc">auto-update triggered</a>, so if you’ve checked for updates, you should be on at least v7.9.1.  I did confirm that v7.9.1 works with my second regex</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64396</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64396</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 26 Mar 2021 14:50:26 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 14:49:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/64394">sample config</a>:</p>
<blockquote>
<p dir="auto">Could it be related to enhancements in Npp v7.9.3 or v7.9.4 releases</p>
</blockquote>
<p dir="auto">I am getting strange results.  The first time I tried in v7.9.2, it didn’t work, and I thought I confirmed that 7.9.2 and 7.9.3 didn’t work.  But then I went back to v7.9.2 and tried my new one followed by my old one, and now it seems that the old regex <em>is</em> working in v7.9.2:</p>
<p dir="auto"><img src="/assets/uploads/files/1616769719562-434db432-416e-4555-8c71-a79c6eee86be-image.png" alt="434db432-416e-4555-8c71-a79c6eee86be-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It’s not truly important.  The fixed regex works consistently for me and for you.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64395</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64395</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 26 Mar 2021 14:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 14:01:31 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>,</p>
<p dir="auto">I <strong>still</strong> don’t understand why I do <strong>not</strong> get any results with your <strong>first</strong> version <strong><code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code></strong> !?</p>
<ul>
<li>
<p dir="auto">Could it be related to <strong>enhancements</strong> in Npp <strong><code>v7.9.3</code></strong> or <strong><code>v7.9.4</code></strong> releases ( <strong>forbidden</strong> with <strong><code>XP</code></strong> machines )</p>
</li>
<li>
<p dir="auto">Could it be related to the <strong>update</strong> of <strong><code>Scintilla</code></strong> ?</p>
</li>
<li>
<p dir="auto">I don’t think that it happens because of <strong>Win XP</strong> itself ! Could you make a <strong>quick</strong> test to verify your <strong>first</strong> regex version with N++ <strong><code>v7.9.2</code></strong>. Thanks !</p>
</li>
</ul>
<hr />
<p dir="auto">Fortunately, your <strong>second</strong> version <strong><code>(?i-s)\A(^(?!username \S+ password \S+).*$\R*)+\z</code></strong> works <strong>nicely</strong>, as the picture, below, shows and finds the <strong>same</strong> files as my own regex. Pretty <strong>reassuring</strong>, isn’t it ?</p>
<p dir="auto"><img src="/assets/uploads/files/1616766923177-fd941129-e704-49f4-a905-c793528b4ec7-image.png" alt="fd941129-e704-49f4-a905-c793528b4ec7-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64394</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64394</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 26 Mar 2021 14:01:31 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 13:14:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/64392">sample config</a>:</p>
<blockquote>
<p dir="auto">I’m terribly sorry but I cannot get your regex <code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code> to work properly :-((</p>
</blockquote>
<p dir="auto">Like I said, that one had bad logic – eating up a whole line before comparing against the unwanted line.   Though I’m not sure why you didn’t get <em>any</em>… When I try it with my bad regex, I matched some of the files correctly, but my <code>pw.txt</code> and your <code>g1.txt</code> were incorrectly matched, because they had the username/password line as the first line:<br />
<img src="/assets/uploads/files/1616764436066-9ca07fd6-cda0-44d8-8a0f-b0c6145500d9-image.png" alt="9ca07fd6-cda0-44d8-8a0f-b0c6145500d9-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Compare to when I switch to my modified/corrected <code>(?i-s)\A(^(?!username \S+ password \S+).*$\R*)+\z</code> regex:<br />
<img src="/assets/uploads/files/1616764209165-f4704910-2919-4d2b-b66a-5cb1b46a4471-image.png" alt="f4704910-2919-4d2b-b66a-5cb1b46a4471-image.png" class=" img-fluid img-markdown" /></p>
<pre><code>Notepad++ v7.9.4   (64-bit)
Build time : Mar 15 2021 - 01:03:10
Path : C:\usr\local\apps\notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS Name : Windows 10 Enterprise (64-bit) 
OS Version : 1903
OS Build : 18362.1256
Current ANSI codepage : 1252
Plugins : ComparePlugin.dll ExtSettings.dll HexEditor.dll LuaScript.dll MarkdownViewerPlusPlus.dll mimeTools.dll NppConsole.dll NppConverter.dll NppEditorConfig.dll NppExec.dll NppExport.dll NppFTP.dll NppUISpy.dll PreviewHTML.dll PythonScript.dll QuickText.dll TagLEET.dll XMLTools.dll 
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/64393</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64393</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 26 Mar 2021 13:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 13:14:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: justin-lang">@<bdi>justin-lang</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> and <strong>All</strong>,</p>
<p dir="auto"><strong>Peter</strong>, I’m <strong>terribly</strong> sorry but I <strong>cannot</strong> get your regex <strong><code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code></strong> to work <strong>properly</strong> :-((</p>
<hr />
<p dir="auto">I’m using <strong>seven</strong> files from <strong><code>G1.txt</code></strong> to <strong><code>G7.txt</code></strong> with N++ <strong><code>v7.9.2</code></strong></p>
<ul>
<li>Contents of <strong><code>G1.txt</code></strong>, with the <strong>concerned</strong> line <strong><code>username •••• password ••••</code></strong> as line <strong><code>1</code></strong> :</li>
</ul>
<pre><code class="language-diff">username blah password blah
usexrname admin pasxsword cisco
some other text
</code></pre>
<ul>
<li>Contents of <strong><code>G2.txt</code></strong>, with the <strong>concerned</strong> line <strong><code>username •••• password ••••</code></strong> as line <strong><code>2</code></strong> :</li>
</ul>
<pre><code class="language-diff">usexrname admin pasxsword cisco
username blah password blah
some other text
</code></pre>
<ul>
<li>Contents of <strong><code>G3.txt</code></strong>, with the <strong>concerned</strong> line <strong><code>username •••• password ••••</code></strong> as line <strong><code>3</code></strong>, <strong>without</strong> EOL chars</li>
</ul>
<pre><code class="language-diff">usexrname admin pasxsword cisco
some other text
username blah password blah
</code></pre>
<ul>
<li>Contents of <strong><code>G4.txt</code></strong>, with a <strong>first blank</strong> line and the <strong>concerned</strong> line <strong><code>username •••• password ••••</code></strong> as line <strong><code>3</code></strong></li>
</ul>
<pre><code class="language-diff">
usexrname admin pasxsword cisco
username blah password blah
some other text
</code></pre>
<ul>
<li>Contents of <strong><code>G5.txt</code></strong>, <strong>without</strong> any line <strong><code>username •••• password ••••</code></strong> :</li>
</ul>
<pre><code class="language-diff">usernxame blah paxssword blah
usexrname admin pasxsword cisco
some other text
</code></pre>
<ul>
<li>Contents of <strong><code>G6.txt</code></strong>, with a <strong>first blank</strong> line and <strong>without</strong> any line <strong><code>username •••• password ••••</code></strong> :</li>
</ul>
<pre><code class="language-diff">
usernxame blah paxssword blah
usexrname admin pasxsword cisco
some other text
</code></pre>
<ul>
<li>Contents of <strong><code>G7.txt</code></strong>, with the <strong>concerned</strong> text <strong><code>username •••• password ••••</code></strong>, surrounded by <strong>digits</strong> ( so <strong>NOT entire</strong> line )</li>
</ul>
<pre><code class="language-diff">usexrname admin pasxsword cisco
12345 username blah password blah 67890
some other text
</code></pre>
<ul>
<li>
<p dir="auto">If I use <strong>my</strong> regex <strong><code>\A(?s)(.*(?i)^username \S+ password \S+$(*SKIP)(*F)|.+?$)</code></strong>, I do find results which seem correct as the regex outputs, with <strong>filter</strong> <strong><code>G*.txt</code></strong> :</p>
<ul>
<li>
<p dir="auto"><strong><code>G5.txt</code></strong> and <strong><code>G6.txt</code></strong> which do <strong>not</strong> contain any <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong></p>
</li>
<li>
<p dir="auto"><strong><code>G7.txt</code></strong> which contains <strong>text</strong> <strong><code>username •••• password ••••</code></strong> but surrounded with <strong>numbers</strong></p>
</li>
</ul>
</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1616763391300-48a38c46-4450-413c-b08a-5f713c5541f0-image.png" alt="48a38c46-4450-413c-b08a-5f713c5541f0-image.png" class=" img-fluid img-markdown" /></p>
<hr />
<ul>
<li>If I use <strong>your</strong> regex <strong><code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code></strong>, I do <strong>not</strong> find any result !?</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1616763543863-30158fca-5cb9-4d0b-b78b-3d7c4a0a3e91-image.png" alt="30158fca-5cb9-4d0b-b78b-3d7c4a0a3e91-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64392</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64392</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 26 Mar 2021 13:14:06 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Fri, 26 Mar 2021 13:07:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: justin-lang">@<bdi>justin-lang</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a>, and <strong>All</strong>,</p>
<p dir="auto">Here is a <strong>second</strong> solution which uses the <strong>backtraking control</strong> verbs <strong><code>(*SKIP)</code></strong> and <strong><code>(*FAIL)</code></strong> or <strong><code>(*F)</code></strong></p>
<p dir="auto">I assume that the goal is to list <strong>all</strong> file(s) that <strong>do not</strong> contain any <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong>, whatever its <strong>case</strong>, when using :</p>
<ul>
<li>
<p dir="auto">The <strong><code>Find All in Current Document</code></strong> button, in the <strong>Find</strong> dialog</p>
</li>
<li>
<p dir="auto">The <strong><code>Find All in All Opened Documents</code></strong> button, in the <strong>Find</strong> dialog</p>
</li>
<li>
<p dir="auto">The <strong><code>Find All</code></strong> button, in the <strong><code>Find in Files</code></strong>  dialog</p>
</li>
</ul>
<hr />
<p dir="auto">SEARCH <strong><code>\A(?s)(.*(?i)^username \S+ password \S+$(*SKIP)(*F)|.+?$)</code></strong></p>
<p dir="auto">How this regex works ?</p>
<ul>
<li>
<p dir="auto">First note that there are <strong>two</strong> alternatives, separated with the <strong><code>|</code></strong> symbol</p>
<ul>
<li>
<p dir="auto"><strong>A)</strong>  <strong><code>\A(?s).*(?i)^username \S+ password \S+$(*SKIP)(*F)</code></strong></p>
<ul>
<li>The part <strong>A</strong> tries to match <strong>any</strong> text from the <strong>very beginning</strong> ( <strong><code>\A</code></strong> ) of <strong>current</strong> file, till a <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong>, whatever its <strong>case</strong>, ( <strong><code>(?i)</code></strong> )</li>
</ul>
</li>
<li>
<p dir="auto"><strong>B)</strong>  <strong><code>\A(?s).+?$</code></strong></p>
<ul>
<li>The part <strong>B</strong> matches <strong>any</strong> text from the <strong>very beginning</strong> of <strong>current</strong> file ( <strong><code>\A</code></strong> ), till the <strong>first non-empty</strong> line,<br />
<strong>included</strong> ( <strong><code>(?s).+?$</code></strong> )</li>
</ul>
</li>
</ul>
</li>
<li>
<p dir="auto">So, from the <strong>very beginning</strong> of file, the regex engine begins to test the <strong>first</strong> alternative and tries to match an <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong></p>
<ul>
<li>
<p dir="auto">If such a line can be found, then :</p>
<ul>
<li>
<p dir="auto">The <strong><code>(SKIP)</code></strong> <strong>control verb</strong>, skips <strong>all</strong> this match and the <strong>working</strong> location is moved to right <strong>after</strong> the line <strong><code>username •••• password ••••</code></strong>.</p>
</li>
<li>
<p dir="auto">The second <strong>control verb</strong> <strong><code>(*F)</code></strong> forces the regex engine to <strong>cancel</strong> this <strong>succesful</strong> match</p>
</li>
<li>
<p dir="auto">So, the regex engine tries the <strong>second</strong> alternative <strong><code>\A(?s).+?$</code></strong>, which also <strong>fails</strong>, as the <strong>current</strong> location is not, anymore, at the <strong>very beginning</strong> of current file !</p>
</li>
<li>
<p dir="auto">As <strong>no</strong> other alternative exists, the <strong>overall</strong> match attempt <strong>fails</strong> and <strong>no</strong> match has been found</p>
</li>
</ul>
</li>
<li>
<p dir="auto">If, from the <strong>very beginning</strong>, any text, ending with the <strong>entire</strong> line <strong><code>username •••• password ••••</code></strong>, <strong>cannot</strong> be found, further on, in <strong>current</strong> file, the <strong>first</strong> alternative is left and the regex engine tries the <strong>second</strong> alternative… which <strong>always</strong> succeeds :</p>
<ul>
<li>
<p dir="auto">The <strong><code>\A</code></strong> assertion is verified as the <strong>current</strong> location is <strong>still</strong> the <strong>very beginning</strong> of current file</p>
</li>
<li>
<p dir="auto">And the part <strong><code>(?s).+?$</code></strong> simply matches <strong>any</strong> text, from the <strong>very beginning</strong>, till the <strong>end</strong> of the <strong><code>first</code> non-empty</strong> line</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr />
<p dir="auto"><strong>Remark</strong> :</p>
<ul>
<li>In order to test this regex against <strong>individual</strong> files, <strong>tick</strong> the <strong><code>Wrap around</code></strong> option and click on the <strong><code>Find Next</code></strong> button</li>
</ul>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64380</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64380</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 26 Mar 2021 13:07:08 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 20:41:06 GMT]]></title><description><![CDATA[<p dir="auto">PS:</p>
<p dir="auto">In case it’s not obvious: when you (or other people) ask us these kind of regex questions, we usually don’t “just know the answer”, we have to figure it out to answer your question.  Just about every regex situation is different, and they require much thought and experimentation to get right (or at least, get “good enough”).</p>
<p dir="auto">The regular users here who answer regex questions have just practiced regex, and have learned a set of tokens that we can build to make more complex expressions.  And (as is obvious from my answer_s_, plural), sometimes we get it wrong (or at least, close, but not good enough for all situations).  We just take the small chunks we know, coupled with the documentation and a willingness to experiment until we get it right, to develop these expressions.  Sometimes, that yields a truly generic expression (<a href="https://community.notepad-plus-plus.org/post/62799">like here</a>) which can be used in plenty of situations; and sometimes, it’s highly customized to the exact requirements of the original questioner.</p>
<p dir="auto">The best way to learn regex is to practice by doing: try out lots of smaller regex expressions, until you get a better understanding of how those small pieces work; then practice putting those building-blocks together in new and unique ways.  The more you practice, the better you get.  (Reading old posts here, and trying to solve the problems, then comparing your solution to the “regulars”'s regexes, is a good way to learn.)</p>
<p dir="auto">Good luck.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64366</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64366</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 25 Mar 2021 20:41:06 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 20:30:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> ,</p>
<p dir="auto">I said,</p>
<blockquote>
<p dir="auto">this might fail if username XXXX password XXXX is the first line of the file.</p>
</blockquote>
<p dir="auto">… and that got me curious.  So I played around some more.</p>
<ul>
<li>FIND = <code>(?i-s)\A(^(?!username \S+ password \S+).*$\R*)+\z</code></li>
</ul>
<p dir="auto">this seemed to work even if the <code>username</code> line was the first or last line in the file.</p>
<p dir="auto">(I am not super great at find-stuff-that-doesn’t-match regex; I can usually get the regex good enough for my needs, but edge cases sometimes escape me)</p>
<ul>
<li><code>\A(...)+\z</code> =&gt; match a file only if every line matches what’s inside the parens</li>
<li><code>^(?!...).*$\R*</code> =&gt; match this line only if the lookahead in the <code>(?!...)</code> isn’t true</li>
<li><code>username \S+ password \S+</code> =&gt; match a sequence that is literal <code>username</code>, space, one or more non-whitespace, space, <code>password</code>, space, one-or-more non-whitespace.</li>
</ul>
<p dir="auto">So, this says match the file, only if every line doesn’t start with <code>username XXXX password YYYYY</code>, where XXXX and YYYY just cannot contain spaces.</p>
<p dir="auto">I think this is a better regex, and worked for me to weed out files that include that whole line (even if it’s at the beginning of the file).  Hopefully, this will work for you and your fileset.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64365</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64365</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 25 Mar 2021 20:30:45 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 20:17:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> said in <a href="/post/64362">sample config</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> that worked great. thanks.  Would you mind to explain what each of the regex does?  I understand ^ indicates the beginning of the line.  (.*) is any character and zero or more preceding characters, but don’t know how (?i-s), \A, \R, \S, \z, and (?!) work.  Thx</p>
</blockquote>
<ul>
<li><code>(?i-s)</code>: this is a <a href="https://npp-user-manual.org/docs/searching/#search-modifiers" rel="nofollow ugc">search modifier</a> expression which makes it case-insensitive, and turns off dot-matches-newline</li>
<li><code>\A</code> is an <a href="https://npp-user-manual.org/docs/searching/#anchors" rel="nofollow ugc">anchor</a> which matches the beginning of the file</li>
<li><code>\R</code> is a <a href="https://npp-user-manual.org/docs/searching/#control-characters" rel="nofollow ugc">control character</a> which matches any newline sequence (<code>\n</code> like Linux, <code>\r</code> like old Macs, <code>\r\n</code> like Windows)</li>
<li><code>\S</code> is the <a href="https://npp-user-manual.org/docs/searching/#character-escape-sequences" rel="nofollow ugc">character escape sequence</a> which means “anything that is not a space character” (<code>\s</code> being "anything that <em>is</em> a space character)</li>
<li><code>\z</code> is an <a href="https://npp-user-manual.org/docs/searching/#anchors" rel="nofollow ugc">anchor</a> which matches the end of the file</li>
<li><code>(?!pattern)</code> is an <a href="https://npp-user-manual.org/docs/searching/#assertions" rel="nofollow ugc">assertion</a> known as a “negative lookahead”, which means that it only matches if what comes next does <em>not</em> match the regex indicated by <code>pattern</code></li>
</ul>
<p dir="auto">(the links above are all inside the main link that <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> just posted)</p>
<p dir="auto">So my fancy regex says, "ignore upper-vs-lowercase; dot does <em>not</em> match newline sequences; start at the beginning of the file; look for one or more lines that are followed by a line which doesn’t match <code>username XXX password XXX</code>, followed by the end of the file.</p>
<p dir="auto">Looking as my logic, this might fail if <code>username XXXX password XXXX</code> is the first line of the file.  If that’s a problem for your data, it will take some tweaking.</p>
<p dir="auto">-—</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as literal text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/14262/how-to-markdown-code-on-this-forum/4">Markdown syntax</a>. To make <code>regex in red</code> (and so they keep their special characters like *), use backticks, like <code>`^.*?blah.*?\z`</code>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get. Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/64364</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64364</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 25 Mar 2021 20:17:34 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 20:11:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> said in <a href="/post/64362">sample config</a>:</p>
<blockquote>
<p dir="auto">explain what each of the regex does?</p>
</blockquote>
<p dir="auto">Some great info in the user manual on this.<br />
See <a href="https://npp-user-manual.org/docs/searching/" rel="nofollow ugc">https://npp-user-manual.org/docs/searching/</a><br />
Scroll down to the section headed “Regular Expressions”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64363</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64363</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 25 Mar 2021 20:11:32 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 19:57:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> that worked great. thanks.  Would you mind to explain what each of the regex does?  I understand ^ indicates the beginning of the line.  (.*) is any character and zero or more preceding characters, but don’t know how (?i-s), \A, \R, \S, \z, and (?!) work.  Thx</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64362</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64362</guid><dc:creator><![CDATA[Justin Lang]]></dc:creator><pubDate>Thu, 25 Mar 2021 19:57:56 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 19:46:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> I am so sorry. I am new to this forum and notepad++.  I will learn and submit question properly next time. Thanks for your help</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64360</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64360</guid><dc:creator><![CDATA[Justin Lang]]></dc:creator><pubDate>Thu, 25 Mar 2021 19:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to sample config on Thu, 25 Mar 2021 16:52:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/justin-lang" aria-label="Profile: Justin-Lang">@<bdi>Justin-Lang</bdi></a> ,</p>
<p dir="auto">You could have just replied to the previous post rather than creating a whole new topic.  That helps discussion flow.</p>
<p dir="auto">You also didn’t use the <code>&lt;/&gt;</code> button, which means that the forum may have corrupted your data.</p>
<p dir="auto">You also didn’t bother pointing out whether that was two example files or just one.</p>
<p dir="auto">All in all, you don’t seem like you want to make it easy for us to help you.  That will dramatically reduce the help we can give you.</p>
<p dir="auto">If I am reading correctly, a file that has a username and password will have a single line with <code>username xxxx password yyyy</code>, no leading or trailing spaces.</p>
<p dir="auto">When I tried a <strong>Find in Files</strong> on two files, with</p>
<ul>
<li>FIND = <code>(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z</code></li>
</ul>
<p dir="auto">where pw.txt had</p>
<pre><code>usexrname admin pasxsword cisco
username blah password blah
some other text
</code></pre>
<p dir="auto">(so line 2 has username and password)<br />
and nopw.txt had:</p>
<pre><code>usernxame blah paxssword blah
usexrname admin pasxsword cisco
some other text
</code></pre>
<p dir="auto">(so that lines 1 and 2 were close, but not actual matches).</p>
<p dir="auto">then <strong>Find in Files</strong> yielded:</p>
<pre><code>Search "(?i-s)\A(^.*\R(?!^username \S+ password \S+$))+\z" (1 hit in 1 file of 2 searched)
  C:\Users\peter.jones\Downloads\TempData\nppCommunity\FindInFiles\nopw.txt (1 hit)
	Line 1: usernxame blah paxssword blah
</code></pre>
<p dir="auto">I cannot guarantee it will work for you (especially if these files are long).  But it might be sufficient for your needs.</p>
<p dir="auto">Good luck.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/64342</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/64342</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 25 Mar 2021 16:52:55 GMT</pubDate></item></channel></rss>