Remove lines with identical extension inside every tag - Regular Expression</a></h1> </div> <div class="grid fw-wrap pb8 mb16 bb bc-black-075"> <div class="grid--cell ws-nowrap mr16 mb8" title="2016-01-12 19:07:53Z"> <span class="fc-light mr2">Asked</span> <time itemprop="dateCreated" datetime="2012-12-25T22:57:22.667" class="fromnow">Dec 25 '12 at 22:57</time> </div> <div class="grid--cell ws-nowrap mr16 mb8"> <span class="fc-light mr2">Active</span> <time class="fromnow" title="2012-12-25T23:25:41.733" datetime="2012-12-25T23:25:41.733">Dec 25 '12 at 23:25</a> </div> <div class="grid--cell ws-nowrap mb8" title="Viewed 121 times"> <span class="fc-light mr2">Viewed</span> 121 times </div> </div> <div id="mainbar" role="main" aria-label="questions and answers"> <div id="question" class="question" data-questionid="14034573" data-ownerid="1502630" data-score="0"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="14034573"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="0">0</div> <button class="js-bookmark-btn s-btn s-btn__unset c-pointer py4"> <svg aria-hidden="true" class="svg-icon iconBookmark" width="18" height="18" viewBox="0 0 18 18"><path d="M6 1a2 2 0 00-2 2v14l5-4 5 4V3a2 2 0 00-2-2H6zm3.9 3.83h2.9l-2.35 1.7.9 2.77L9 7.59l-2.35 1.7.9-2.76-2.35-1.7h2.9L9 2.06l.9 2.77z"></path></svg> <div class="js-bookmark-count mt4" data-value=""></div> </button> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>I create a Report List with Winrar. <br/>Inside this list i have a text list like this<br/></p> <pre><code><tag>Adventures of Shuggy</tag> !Shuggy.png !Sound Bank.txt 4.lwav 5.lwav 6.lwav 88.lwav 89.lwav <tag>Adventures of Jack</tag> 90.lwav 91.lwav 92.lwav 93.lwav !Sound Bank.xsb </code></pre> <p>I want remove duplicates extensions <em>inside every tag </em> and have a text like this:</p> <pre><code><tag>Adventures of Shuggy</tag> !Shuggy.png !Sound Bank.txt 4.lwav <tag>Adventures of Jack</tag> 90.lwav !Sound Bank.xsb </code></pre> <p>or even better</p> <pre><code><tag>Adventures of Shuggy</tag> .png .txt .lwav <tag>Adventures of Jack</tag> .xsb </code></pre> <p>Is there a regular expression to use on notepad++ to remove <strong>lines with identical</strong> <em>.txt</em> or identical <em>.lwav</em> inside every tag like <code><title></code>?<br/> Can i use excel for this?</p></div> <div class="mt24 mb12"> <div class="post-taglist grid gs4 gsy fd-column"> <div class="grid ps-relative"> <a href="../../questions/tagged/regex" class="post-tag js-gps-track" title="show questions tagged 'regex'" rel="tag">regex</a> <a href="../../questions/tagged/notepad++" class="post-tag js-gps-track" title="show questions tagged 'notepad++'" rel="tag">notepad++</a> <a href="../../questions/tagged/archive" class="post-tag js-gps-track" title="show questions tagged 'archive'" rel="tag">archive</a> <a href="../../questions/tagged/winrar" class="post-tag js-gps-track" title="show questions tagged 'winrar'" rel="tag">winrar</a> </div> </div> </div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature owner grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 25 '12 at 22:57">asked Dec 25 '12 at 22:57</time> <a href="../../users/1502630/user143822" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1502630.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="user143822" /> </a> <div class="s-user-card--info"> <a href="../../users/1502630/user143822" class="s-user-card--link">user143822</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">237</li> <li class="s-award-bling s-award-bling__silver" title="2 silver badges">2</li> <li class="s-award-bling s-award-bling__bronze" title="9 bronze badges">9</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> <div id="comments-14034573" class="comments js-comments-container bt bc-black-075 mt12 " data-post-id="14034573" data-min-length="15"> <ul class="comments-list js-comments-list" data-remaining-comments-count="0" data-canpost="false" data-cansee="true" data-comments-unavailable="false" data-addlink-disabled="true"> <li id="comment-19387823" class="comment js-comment " data-comment-id="19387823" data-comment-owner-id="1655939" data-comment-score="0"> <div class="js-comment-actions comment-actions"> <div class="comment-score js-comment-edit-hide"> </div> </div> <div class="comment-text js-comment-text-and-form"> <a name="comment19387823_14034573"></a> <div class="comment-body js-comment-edit-hide"> <span class="comment-copy">can i use excel for what? lol (: -- ignore my ignorance, i'm not an excel user</span> – <a href="../../users/1655939/rubens" title="14,478 reputation" class="comment-user ">Rubens</a> <span class="comment-date" dir="ltr"><a class="comment-link" href="../../questions/14034573/remove-lines-with-identical-extension-inside-every-title-tag-regular-expressio#comment19387823_14034573"><span title="2012-12-25T23:10:48.543 License: CC BY-SA 3.0" class="relativetime-clean">Dec 25 '12 at 23:10</span></a></span> </div> </div> </li> <li id="comment-19387842" class="comment js-comment " data-comment-id="19387842" data-comment-owner-id="707111" data-comment-score="0"> <div class="js-comment-actions comment-actions"> <div class="comment-score js-comment-edit-hide"> </div> </div> <div class="comment-text js-comment-text-and-form"> <a name="comment19387842_14034573"></a> <div class="comment-body js-comment-edit-hide"> <span class="comment-copy">Those aren’t inside tags, they’re after the tags...</span> – <a href="../../users/707111/ry" title="218,210 reputation" class="comment-user ">Ry-</a> <span class="comment-date" dir="ltr"><a class="comment-link" href="../../questions/14034573/remove-lines-with-identical-extension-inside-every-title-tag-regular-expressio#comment19387842_14034573"><span title="2012-12-25T23:13:53.450 License: CC BY-SA 3.0" class="relativetime-clean">Dec 25 '12 at 23:13</span></a></span> </div> </div> </li> </ul> </div> </div> </div> </div> <div id="answers"> <a name="tab-top"></a> <div id="answers-header"> <div class="answers-subheader grid ai-center mb8"> <div class="grid--cell fl1"> <h2 class="mb0" data-answercount="9">1 Answers<span style="display:none;" itemprop="answerCount">1</span></h2> </div> </div> </div> <a name="14034689"></a> <div id="answer-14034689" class="answer accepted-answer" data-answerid="14034689" data-ownerid="1548853" data-score="1" itemprop="acceptedAnswer" itemscope="" itemtype="https://schema.org/Answer"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="14034689"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="1">1</div> <div class="js-accepted-answer-indicator grid--cell fc-green-500 py6 mtn8"><div class="ta-center"><svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="m6 14 8 8L30 6v8L14 30l-8-8v-8z"></path></svg></div></div> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>Tossed this up real quick. Should work fine in notepad++. Make sure to set the global flag (if there is one) and the multiline one.</p> <pre><code>/^.+(\.[^.]+)$(?=\s*(?:(?!<tag>)[^.])+\1)|^(?!<tag>)[^.]+/gm </code></pre> <p>You should (most likely) not use the flags and delimiters like I have above. I'm sure you'll figure it out.</p> <p>Explanation + demo : <a class="external-link" href="http://regex101.com/r/lC0lD1" rel="nofollow">http://regex101.com/r/lC0lD1</a></p></div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="answered Dec 25 '12 at 23:25">answered Dec 25 '12 at 23:25</time> <a href="../../users/1548853/firas-dib" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1548853.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Firas Dib" /> </a> <div class="s-user-card--info"> <a href="../../users/1548853/firas-dib" class="s-user-card--link">Firas Dib</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">2,743</li> <li class="s-award-bling s-award-bling__silver" title="19 silver badges">19</li> <li class="s-award-bling s-award-bling__bronze" title="38 bronze badges">38</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> </div> </div> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>