<?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[Using sets to find A-Za-z plus the # and - chars ..?]]></title><description><![CDATA[<p dir="auto">I’m trying to find and replace some URLs.</p>
<p dir="auto">This is an example of what URL links look like:</p>
<p dir="auto"><code>http://mysitename.net/index.php/pagename#bookmark</code><br />
<code>http://mysitename.net/index.php/pagename-hypen</code></p>
<p dir="auto">I need to replace these with, for example:<br />
<code>http://mysitename.net/index.php/pagename - mysitename.mhtml#bookmark</code><br />
(So I need to store pagename in  ${1} and bookmark in ${2}.)</p>
<p dir="auto">You can see I can’t just search for <code>(\w*)</code> because of the <code>-</code> and <code>#</code> and probably <code>%</code> literal chars that may appear.</p>
<p dir="auto">I looked at sets.  <code>([A-Za-z#-%])</code> but that didn’t seem to work.  And I tried <code>(\w*-*#*)</code> and that didn’t work either.  Any ideas on what would work for me?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/23762/using-sets-to-find-a-za-z-plus-the-and-chars</link><generator>RSS for Node</generator><lastBuildDate>Sun, 07 Jun 2026 09:05:11 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/23762.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Nov 2022 14:54:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Wed, 23 Nov 2022 23:35:31 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>,</p>
<p dir="auto">In my <strong>previous</strong> post, I forgot to mention the <strong><code>^</code></strong> character, which has a <strong>special</strong> meaning within a <strong><code>Character class</code></strong> !</p>
<p dir="auto">So, here is an <strong>updated</strong> version of my <strong>previous</strong> post :</p>
<pre><code class="language-diff">If we consider the following CHARACTER CLASS structure :

[.......]
123456789

The POSSIBLE location(s), in order to find the LITERAL character below, are :

LITERAL Character [    :     POSSIBLE at any position, BETWEEN 2 to 8 
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
							 
LITERAL Character ]    :     POSSIBLE at position 2 ONLY
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
							 
LITERAL Character -    :     POSSIBLE at position 2
                             POSSIBLE at position 8
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character

LITERAL character ^    :     POSSIBLE at any position, BETWEEN 3 and 8
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character

							 
LITERAL Character \    :     POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
</code></pre>
<hr />
<p dir="auto">And I suppose that <a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: alan-kilborn">@<bdi>alan-kilborn</bdi></a> could add :</p>
<blockquote>
<p dir="auto">To use a “literal <code>^</code>” in a character class: Use it directly like any other character, e.g. <code>[ab^c]</code>, <strong>but</strong> right after the opening <code>[</code> of the class notation ; “escaping” is not necessary (but is permissible), e.g. <code>[ab\^c]</code></p>
</blockquote>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81889</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81889</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 23 Nov 2022 23:35:31 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Sat, 19 Nov 2022 21:16:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> hahahah yes  no way would I bet my house on any regular expression I recommend covering all, no matter how perverse, eventualities…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81766</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81766</guid><dc:creator><![CDATA[Andrew McP]]></dc:creator><pubDate>Sat, 19 Nov 2022 21:16:51 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Sat, 19 Nov 2022 21:06:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andrew-mcp" aria-label="Profile: Andrew-McP">@<bdi>Andrew-McP</bdi></a> said in <a href="/post/81761">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">I really admire you guys for figuring out Regular Expressions</p>
</blockquote>
<p dir="auto">So if someone says they have “figured out regular expressions”, I pity them.  Because it just means they are ripe for an upcoming whipping when a regex misunderstanding of theirs really embarrasses them.  :-)</p>
<p dir="auto">It pays to always be humble when discussing regular expressions with others. :-)</p>
<blockquote>
<p dir="auto">I bet you never get lost</p>
</blockquote>
<p dir="auto">GPS!</p>
<blockquote>
<p dir="auto">I like the trick of having - as last character before ]</p>
</blockquote>
<p dir="auto">Not so much a trick, as a logical place to put it when you realize that anywhere except the first or last position it must form some sort of “range”.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81763</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81763</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Nov 2022 21:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Sat, 19 Nov 2022 20:58:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a>  I really admire you guys for figuring out Regular Expressions; I bet you never get lost in real life when you can keep track of the patterns/positions so well, aka good spatial awareness :)</p>
<p dir="auto">Oh and I like the trick of having - as last character before ]</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81761</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81761</guid><dc:creator><![CDATA[Andrew McP]]></dc:creator><pubDate>Sat, 19 Nov 2022 20:58:18 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 16:02:30 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/81732">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">do you intend to include, in some way, the end part of this post, regarding the Free-space mode</p>
</blockquote>
<p dir="auto">He already did, see <a href="https://github.com/notepad-plus-plus/npp-usermanual/pull/432" rel="nofollow ugc">HERE</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81733</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81733</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 18 Nov 2022 16:02:30 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 15:54:03 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">BTW, <strong>Peter</strong>, do you intend to include, in some way, the <strong>end</strong> part of this post, regarding the <strong><code>Free-space</code></strong> mode, which is in the <strong>Notes</strong> section ?</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/81368">https://community.notepad-plus-plus.org/post/81368</a></p>
<hr />
<p dir="auto">Also, did you correctly receive, by <strong>e-mail</strong>, my <strong>attached</strong> text file, regarding the <strong><code>TextFX</code></strong> features ?</p>
<p dir="auto">Please, I do <strong>not</strong> want to stress you, unnecessarily ! Just go at your own pace !</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81732</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81732</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 18 Nov 2022 15:54:03 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 15:22:45 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></p>
<p dir="auto">Maybe my first-of-4 bullet points previously should be moved to be the last-of-4, and changed to:</p>
<ul>
<li>To use any other literal character in a character class, just use it directly, i.e., no “escaping” needed</li>
</ul>
<hr />
<p dir="auto">Maybe it works well as a 2 column 4 row table, headers:</p>
<ul>
<li>Character</li>
<li>To use it literally in a character class</li>
</ul>
<p dir="auto">With those headers, the “cell contents” for column 2 could be appropriately shortened to remove redundant verbiage.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81716</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81716</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 18 Nov 2022 15:22:45 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 14:14:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> &amp; <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> ,</p>
<p dir="auto">I like those suggestions, especially the way Alan rephrased it: it works much better than my clunky first attempt in the manual, that only included <code>-</code> and was not not very readable.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81714</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81714</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 18 Nov 2022 14:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 12:35:07 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>
<p dir="auto">It is rather awkward to express, but I like your idea.</p>
<p dir="auto">My idea for expression:</p>
<ul>
<li>
<p dir="auto">To use a “literal <code>[</code>” in a character class:  Use it directly like any other character, e.g. <code>[ab[c]</code>; “escaping” is not necessary (but is permissible), e.g. <code>[ab\\[c]</code></p>
</li>
<li>
<p dir="auto">To use a “literal <code>]</code>” in a character class:  Directly right after the opening <code>[</code> of the class notation, e.g. <code>[]abc]</code>, OR “escaped” at any position, e.g. <code>[\\]abc]</code> or <code>[a\\]bc]</code></p>
</li>
<li>
<p dir="auto">To use a “literal <code>-</code>” in a character class:  Directly as the first or last character in the enclosing class notation, e.g. <code>[-abc]</code> or <code>[abc-]</code>, OR “escaped” at any position, e.g. <code>[\-abc]</code> or <code>[a\-bc]</code></p>
</li>
<li>
<p dir="auto">To use a “literal <code>\</code>” in a character class:  Must be doubled (i.e., <code>\\</code>) inside the enclosing class notation, e.g. <code>[ab\\c]</code></p>
</li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/81712</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81712</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Fri, 18 Nov 2022 12:35:07 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Fri, 18 Nov 2022 11:58:28 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>,</p>
<p dir="auto">In the post below, <strong>Peter</strong> :</p>
<p dir="auto"><a href="https://community.notepad-plus-plus.org/post/81643">https://community.notepad-plus-plus.org/post/81643</a></p>
<p dir="auto">You said :</p>
<blockquote>
<p dir="auto">Actually, it’s not documented in our character classes section. I will remedy that.</p>
</blockquote>
<p dir="auto">Then, regarding the <strong><code>Character Class</code></strong> feature, may be, this part could be <strong>added</strong> to the <strong><code>Official Notepad++ Documentation :</code></strong> :</p>
<pre><code class="language-diff">If we consider the following CHARACTER CLASS structure :

[.......]
123456789

The POSSIBLE location(s), in order to find the LITERAL character below, are :

LITERAL Character [    :     POSSIBLE at any position, BETWEEN 2 to 8 
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
							 
LITERAL Character ]    :     POSSIBLE at position 2 ONLY
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
							 
LITERAL Character -    :     POSSIBLE at position 2
                             POSSIBLE at position 8
                             POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
							 
LITERAL Character \    :     POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character
</code></pre>
<hr />
<p dir="auto">Of course, change this <strong>layout</strong> as you like !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81709</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81709</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Fri, 18 Nov 2022 11:58:28 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 19:46:07 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> said in <a href="/post/81668">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">FIND = <a href="http://mysitename.net/index.php/(%5B%5Cw%25.~-%5D+)#(%5B%5Cw%25.~-%5D+)" rel="nofollow ugc">http://mysitename.net/index.php/([\w%.~-]+)#([\w%.~-]+)</a>"</p>
</blockquote>
<p dir="auto">Is it worth pointing out that the first two periods here really aren’t periods but rather “match any char”, because they aren’t escaped?  Sure, an unescaped <code>.</code> will match a literal period, but it will match other things as well (obviously).</p>
<p dir="auto">IMO, OP here needs to stop asking forum questions and go off and study regex.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81677</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81677</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Thu, 17 Nov 2022 19:46:07 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 18:46:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iansunlun" aria-label="Profile: IanSunlun">@<bdi>IanSunlun</bdi></a> ,</p>
<p dir="auto">Except for <code>-</code>, order doesn’t matter inside the <code>[]</code> character class.  The period is there because <code>New.Video#column-one</code> is also a valid URL <s>ender</s> <em>end-string</em>.</p>
<p dir="auto">FIND = <code>http://mysitename.net/index.php/([\w%.~-]+)#([\w%.~-]+)"</code><br />
<em>does</em> match <code>http://mysitename.net/index.php/New_Video#column-one"</code>:</p>
<p dir="auto"><img src="/assets/uploads/files/1668705405168-2fb36c05-cd1f-406d-92f6-ec71aec5bb2a-image.png" alt="2fb36c05-cd1f-406d-92f6-ec71aec5bb2a-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/81668</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81668</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Nov 2022 18:46:45 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 16:28:40 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> said in <a href="/post/81658">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">FIND = <a href="http://mysitename.net/index.php/(%5B%5Cw%25.~-%5D+)#(%5B%5Cw%25.~-%5D+)" rel="nofollow ugc">http://mysitename.net/index.php/([\w%.~-]+)#([\w%.~-]+)</a>"</p>
</blockquote>
<p dir="auto">With the period <code>.</code> inbetween the <code>%</code> and the <code>~</code> it did not find:<br />
<code>http://mysitename.net/index.php/New_Video#column-one"</code><br />
But taking the period out, it did find it.<br />
Whats the thinking behind the period in this context ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81663</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81663</guid><dc:creator><![CDATA[IanSunlun]]></dc:creator><pubDate>Thu, 17 Nov 2022 16:28:40 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 16:23:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iansunlun" aria-label="Profile: IanSunlun">@<bdi>IanSunlun</bdi></a> said in <a href="/post/81655">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">Does [\w%#.~-]+ put whatever it matches into ${1} ?</p>
</blockquote>
<p dir="auto">Sorry, when I answered, I had forgotten that you previously said,</p>
<blockquote>
<p dir="auto">(So I need to store pagename in ${1} and bookmark in ${2}.)</p>
</blockquote>
<p dir="auto">Putting the <code>#</code> into either match is <em>not</em> what you want, either.  You really need two groups, one before the # and one after.</p>
<p dir="auto">FIND = <code>http://mysitename.net/index.php/([\w%.~-]+)#([\w%.~-]+)"</code><br />
will only match if there is a bookmark, and the # will not be inside the ${2} group. If you want the # to be included in ${2}, use <code>http://mysitename.net/index.php/([\w%.~-]+)(#[\w%.~-]+)"</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/81658</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81658</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Nov 2022 16:23:13 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 16:02:04 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> Ah, thats seems to work thanks.<br />
Does <code>[\w%#.~-]+</code> put whatever it matches into ${1} ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81655</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81655</guid><dc:creator><![CDATA[IanSunlun]]></dc:creator><pubDate>Thu, 17 Nov 2022 16:02:04 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 16:14:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iansunlun" aria-label="Profile: IanSunlun">@<bdi>IanSunlun</bdi></a><br />
Hello :) Try this in Npp: (Just to easily verify that it matches)</p>
<pre><code>Find: [.#\-%]
</code></pre>
<p dir="auto"><strong>Inside a character class  [set]:</strong></p>
<p dir="auto">The character # is literal<br />
The character % is literal<br />
The <code>.</code>  It is literal (remember that outside equals any character.)<br />
<code>\-</code> The only one that needs an escape sequence using <code>\</code> .</p>
<p dir="auto">So:<br />
<code>[A-Za-z#\-%.]</code><br />
The second hyphen is inside in an escape sequence (preceded by \ ).</p>
<p dir="auto">Another character that needs escape is ^ because of its negation meaning within the brackets <code>[\^]</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81653</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81653</guid><dc:creator><![CDATA[José Luis Montero Castellanos]]></dc:creator><pubDate>Thu, 17 Nov 2022 16:14:03 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 15:55:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iansunlun" aria-label="Profile: IanSunlun">@<bdi>IanSunlun</bdi></a> said in <a href="/post/81648">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto"><code>http://mysitename.net/index.php/New_Video#column-one"</code></p>
</blockquote>
<p dir="auto">Um, no it shouldn’t.  <code>New_Video#column-one</code> is more than one character.  <code>[A-Za-z%#_-]</code> only matches one character.</p>
<p dir="auto">I think what you want is <code>http://mysitename.net/index.php/[A-Za-z%#_-]+"</code> , which wants one or more charaters from that set.</p>
<p dir="auto">Also, I hope you don’t have a URL like <code>http://mysitename.net/index.php/one1#column2</code></p>
<p dir="auto">Or <code>http://school.edu/~username/o.n.e.#2</code> , which is something I might have had back in my university homepage days, lo those two-and-a-half decades ago.</p>
<p dir="auto">Maybe use <code>http://mysitename.net/index.php/[\w%#.~-]+"</code>, since <code>\w</code> encompases the <code>[A-Za-z0-9_]</code> portion, and it adds in the URL-safe characters of . and ~, as well as the # separator and %-encoding-start.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81651</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81651</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Nov 2022 15:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 15:47:15 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><br />
My search term is not finding the URL in my html page.<br />
<img src="/assets/uploads/files/1668699914565-e1171fc4-f61d-46e5-b069-6cc0b0be6192-image.png" alt="e1171fc4-f61d-46e5-b069-6cc0b0be6192-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">html page (its not finding this, but it should):<br />
<code>http://mysitename.net/index.php/New_Video#column-one"</code></p>
]]></description><link>https://community.notepad-plus-plus.org/post/81648</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81648</guid><dc:creator><![CDATA[IanSunlun]]></dc:creator><pubDate>Thu, 17 Nov 2022 15:47:15 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 15:02:20 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> said in <a href="/post/81641">Using sets to find A-Za-z plus the # and - chars ..?</a>:</p>
<blockquote>
<p dir="auto">As is documented</p>
</blockquote>
<p dir="auto">Actually, it’s not documented in <em>our</em> <a href="https://npp-user-manual.org/docs/searching/#character-classes" rel="nofollow ugc">character classes</a> section.  I will remedy that.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81643</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81643</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Nov 2022 15:02:20 GMT</pubDate></item><item><title><![CDATA[Reply to Using sets to find A-Za-z plus the # and - chars ..? on Thu, 17 Nov 2022 15:00:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/iansunlun" aria-label="Profile: IanSunlun">@<bdi>IanSunlun</bdi></a> ,</p>
<p dir="auto">As is documented, <code>-</code> has special meaning in regex character sets.  If you want it to be treated as a literal in a character set, it needs to be either the first or last character in the set.</p>
<p dir="auto">Compare yours:<br />
<img src="/assets/uploads/files/1668696996002-06cd8970-c9c3-4f48-a86b-6d11092cdb3c-image.png" alt="06cd8970-c9c3-4f48-a86b-6d11092cdb3c-image.png" class=" img-fluid img-markdown" /><br />
to this <code>[A-Za-z#%-]</code>:<br />
<img src="/assets/uploads/files/1668697019381-55485809-73fa-4c09-a69a-02d767886454-image.png" alt="55485809-73fa-4c09-a69a-02d767886454-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">or, going back to yours, with the <code>$</code> in the text file:<br />
<img src="/assets/uploads/files/1668697104841-81c093b8-7447-435b-885c-29f46a07496a-image.png" alt="81c093b8-7447-435b-885c-29f46a07496a-image.png" class=" img-fluid img-markdown" /><br />
vs<br />
<img src="/assets/uploads/files/1668697212370-a1a807f1-8615-4134-8149-0155e8995a8e-image.png" alt="a1a807f1-8615-4134-8149-0155e8995a8e-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">… the <code>[#-%]</code> portion of the character set says “characters <code>#</code> through <code>%</code>”, which includes the <code>$</code> between those, so <code>[#-%]</code> will match <code>#</code> or <code>$</code> or <code>%</code>.  Whereas <code>[#%-]</code> says “match <code>#</code> or <code>%</code> or the literal <code>-</code>”</p>
]]></description><link>https://community.notepad-plus-plus.org/post/81641</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/81641</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 17 Nov 2022 15:00:17 GMT</pubDate></item></channel></rss>