<?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[Regular Expressions]]></title><description><![CDATA[<p dir="auto">I have text files like that:</p>
<p dir="auto"><em>true<br />
{<br />
true<br />
0.890000 0.195000 2000.000000<br />
}<br />
true<br />
{<br />
false<br />
0.000000<br />
}<br />
{<br />
version 0<br />
0.385000<br />
}<br />
<em>{<br />
version 1<br />
diffuse= maps/Autumn.dds<br />
specular = Forest.dds<br />
}</em><br />
false<br />
0.003208<br />
“”<br />
1<br />
“FogLinear” "-212.500000 3450.000000 0.000000 0.301961 0.380392 0.415686 "<br />
false<br />
{<br />
version 1<br />
}</em></p>
<p dir="auto">I need find:<br />
<em>{<br />
version 1<br />
diffuse= maps/Autumn.dds<br />
specular = Forest.dds<br />
}</em><br />
and<br />
<em>{<br />
version 1<br />
}</em></p>
<p dir="auto">excluding:</p>
<p dir="auto"><em>{<br />
version 0<br />
0.385000<br />
}</em></p>
<p dir="auto">And delete it. How can this be done?</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/16278/regular-expressions</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 16:00:58 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/16278.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Sep 2018 19:11:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Regular Expressions on Thu, 06 Sep 2018 19:38:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a>, you may be right. I had originally interpreted it the way I had, but reading again, I’m heading your direction now.</p>
<p dir="auto">It all goes back to getting “good” and “clear” information. I was looking at them like html tags, so an opening and closing “version 1” pair.</p>
<p dir="auto">The OP will have choices now and when they try each option they can make the decision for themselves…</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34688</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34688</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Thu, 06 Sep 2018 19:38:20 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Thu, 06 Sep 2018 12:07:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said:</p>
<blockquote>
<p dir="auto">(?s)({\Rversion 1.+?version 1\R})</p>
</blockquote>
<p dir="auto">Hmmm…using the sample data provided, that seems to remove all this:</p>
<pre><code class="language-z">{
version 1
diffuse= maps/Autumn.dds
specular = Forest.dds
}
false
0.003208
“”
1
“FogLinear” "-212.500000 3450.000000 0.000000 0.301961 0.380392 0.415686 "
false
{
version 1
}
</code></pre>
<p dir="auto">…which seems like maybe removing too much?</p>
<p dir="auto">To follow what the OP said initially, I’d try:</p>
<p dir="auto"><strong>Find what</strong> zone: <code>{\Rversion 1[^}]+\}</code><br />
<strong>Replace with</strong> zone: leave this empty<br />
<strong>Wrap around</strong> checkbox: as you like it<br />
<strong>Search mode</strong>: Regular expression<br />
Action: Press <strong>Replace</strong> / <strong>Replace All</strong> button</p>
<p dir="auto">Which leaves one with the following after replacement:</p>
<pre><code class="language-z">true
{
true
0.890000 0.195000 2000.000000
}
true
{
false
0.000000
}
{
version 0
0.385000
}

false
0.003208
“”
1
“FogLinear” "-212.500000 3450.000000 0.000000 0.301961 0.380392 0.415686 "
false
</code></pre>
<p dir="auto">Here’s an explanation of how the find works (replacement is merely with nothing):</p>
<h4>THE FIND EXPRESSION:</h4>
<p dir="auto"><code>{\Rversion 1[^}]+\}</code></p>
<ul>
<li>[Match the character “{” literally][<em><strong>1</strong></em> ] <code>{</code></li>
<li>[Match a line break (carriage return and line feed pair, sole line feed, sole carriage return, vertical tab, form feed)][<em><strong>2</strong></em> ] <code>\R</code></li>
<li>[Match the character string “version 1” literally (case sensitive)][<em><strong>1</strong></em> ] <code>version 1</code></li>
<li>[Match any character that is NOT a “}”][<em><strong>1</strong></em> ] <code>[^}]+</code>
<ul>
<li>[Between one and unlimited times, as many times as possible, giving back as needed (greedy)][<em><strong>3</strong></em> ] <code>+</code></li>
</ul>
</li>
<li>[Match the character “}” literally][<em><strong>4</strong></em> ] <code>\}</code></li>
</ul>
<p dir="auto">Created with <a href="http://www.regexbuddy.com/" rel="nofollow ugc">RegexBuddy</a></p>
<p dir="auto">[<em><strong>1</strong></em> ]: <a href="http://www.regular-expressions.info/characters.html" rel="nofollow ugc">http://www.regular-expressions.info/characters.html</a><br />
[<em><strong>2</strong></em> ]: <a href="http://www.regular-expressions.info/nonprint.html" rel="nofollow ugc">http://www.regular-expressions.info/nonprint.html</a><br />
[<em><strong>3</strong></em> ]: <a href="http://www.regular-expressions.info/repeat.html" rel="nofollow ugc">http://www.regular-expressions.info/repeat.html</a><br />
[<em><strong>4</strong></em> ]: <a href="http://www.regular-expressions.info/characters.html#special" rel="nofollow ugc">http://www.regular-expressions.info/characters.html#special</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/34667</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34667</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Thu, 06 Sep 2018 12:07:31 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Wed, 05 Sep 2018 23:42:46 GMT]]></title><description><![CDATA[<p dir="auto">Without further information all I can present is<br />
Find what: <code>(?s)(\{\Rversion 1.+?version 1\R\})</code><br />
Replace with: <code>leave this field empty</code></p>
<p dir="auto">This will capture ALL “version 1” sequences from opening { to closing }. Hopefully you can see where your regex might have failed and this one works and learn from that.</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34654</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34654</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 05 Sep 2018 23:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Wed, 05 Sep 2018 22:03:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/scott-sumner" aria-label="Profile: Scott-Sumner">@<bdi>Scott-Sumner</bdi></a> said:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor-fatal" aria-label="Profile: Victor-Fatal">@<bdi>Victor-Fatal</bdi></a></p>
<p dir="auto">You have asked regular expression related questions here before…what regular expression replacement have you tried for your current problem?  It’s always good to see what one is considering for a solution, even if it isn’t quite working.</p>
</blockquote>
<p dir="auto">so far I have come to this search query request:<br />
version 1.*?[}]<br />
but I can not get the upper brace.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34652</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34652</guid><dc:creator><![CDATA[Victor Fatal]]></dc:creator><pubDate>Wed, 05 Sep 2018 22:03:53 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Wed, 05 Sep 2018 21:39:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/terry-r" aria-label="Profile: Terry-R">@<bdi>Terry-R</bdi></a> said:</p>
<blockquote>
<p dir="auto">So if I read correctly you are searching for only the “version 1” sequence ending with the relevant “}”. Within version 1 is it ONLY with autumn.dds or is any text allowed within version 1?</p>
</blockquote>
<p dir="auto">Terry I need delete all this stuff:<br />
<em>{<br />
version 1<br />
diffuse= maps/Autumn.dds<br />
specular = Forest.dds<br />
}</em><br />
From “{” to “}”, but  exclude blocks which have “version 0” like this:<br />
<em>{<br />
version 0<br />
0.385000<br />
}</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/34651</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34651</guid><dc:creator><![CDATA[Victor Fatal]]></dc:creator><pubDate>Wed, 05 Sep 2018 21:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Wed, 05 Sep 2018 19:59:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor-fatal" aria-label="Profile: Victor-Fatal">@<bdi>Victor-Fatal</bdi></a></p>
<p dir="auto">You have asked regular expression related questions here before…what regular expression replacement have you tried for your current problem?  It’s always good to see what one is considering for a solution, even if it isn’t quite working.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34644</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34644</guid><dc:creator><![CDATA[Scott Sumner]]></dc:creator><pubDate>Wed, 05 Sep 2018 19:59:58 GMT</pubDate></item><item><title><![CDATA[Reply to Regular Expressions on Wed, 05 Sep 2018 19:53:25 GMT]]></title><description><![CDATA[<p dir="auto">So if I read correctly you are searching for only the “version 1” sequence ending with the relevant “}”. Within version 1 is it ONLY with autumn.dds or is any text allowed within version 1?</p>
<p dir="auto">Terry</p>
]]></description><link>https://community.notepad-plus-plus.org/post/34643</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/34643</guid><dc:creator><![CDATA[Terry R]]></dc:creator><pubDate>Wed, 05 Sep 2018 19:53:25 GMT</pubDate></item></channel></rss>