<?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[Frage zu RegEx]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p>ich arbeite mich aktuell in Reguläre Ausdrücke ein und habe ein Beispiel konstruiert, was ich nicht verstehe.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;regex&gt;

int main(int, char **)
{
   std::string test_match(&quot;abc \r\n def&quot;);
   std::string test_nomatch(&quot;abc \r\n def \r\n&quot;);

   std::regex rgx(R&quot;(^[^\r]*\r\n.*$)&quot;);

   if(std::regex_match(test_match, rgx))
      std::cout &lt;&lt; &quot;match&quot; &lt;&lt; std::endl;
   else
      std::cout &lt;&lt; &quot;no match&quot; &lt;&lt; std::endl;

   if(std::regex_match(test_nomatch, rgx))
      std::cout &lt;&lt; &quot;match&quot; &lt;&lt; std::endl;
   else
      std::cout &lt;&lt; &quot;no match&quot; &lt;&lt; std::endl;

   return 0;
}
</code></pre>
<p>Output ist bei mir folgender:</p>
<p><strong>match<br />
no match</strong></p>
<p>Warum matched das zweite nicht?<br />
Kann bitte jemand mein Gehirn entknoten? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>gruß Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/337183/frage-zu-regex</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 10:02:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/337183.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Mar 2016 11:17:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Frage zu RegEx on Mon, 14 Mar 2016 11:17:31 GMT]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p>ich arbeite mich aktuell in Reguläre Ausdrücke ein und habe ein Beispiel konstruiert, was ich nicht verstehe.</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;regex&gt;

int main(int, char **)
{
   std::string test_match(&quot;abc \r\n def&quot;);
   std::string test_nomatch(&quot;abc \r\n def \r\n&quot;);

   std::regex rgx(R&quot;(^[^\r]*\r\n.*$)&quot;);

   if(std::regex_match(test_match, rgx))
      std::cout &lt;&lt; &quot;match&quot; &lt;&lt; std::endl;
   else
      std::cout &lt;&lt; &quot;no match&quot; &lt;&lt; std::endl;

   if(std::regex_match(test_nomatch, rgx))
      std::cout &lt;&lt; &quot;match&quot; &lt;&lt; std::endl;
   else
      std::cout &lt;&lt; &quot;no match&quot; &lt;&lt; std::endl;

   return 0;
}
</code></pre>
<p>Output ist bei mir folgender:</p>
<p><strong>match<br />
no match</strong></p>
<p>Warum matched das zweite nicht?<br />
Kann bitte jemand mein Gehirn entknoten? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f60b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_savoring_food"
      title=":yum:"
      alt="😋"
    /></p>
<p>gruß Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2490279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2490279</guid><dc:creator><![CDATA[It0101]]></dc:creator><pubDate>Mon, 14 Mar 2016 11:17:31 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu RegEx on Mon, 14 Mar 2016 11:37:41 GMT]]></title><description><![CDATA[<p>It0101 schrieb:</p>
<blockquote>
<p>Warum matched das zweite nicht?</p>
</blockquote>
<p>Weil die im Regex definierten Regeln wohl nicht auf den zweiten String zutreffen, nehme ich an.<br />
Wenn das eine Regex Frage ist, kann ich dir <a href="https://regex101.com/" rel="nofollow">diese Seite</a> empfehlen, hilft beim Regex basteln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2490281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2490281</guid><dc:creator><![CDATA[Singender Holzkübel]]></dc:creator><pubDate>Mon, 14 Mar 2016 11:37:41 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu RegEx on Mon, 14 Mar 2016 11:45:20 GMT]]></title><description><![CDATA[<p>Das Atom <code>.</code> matched keine Newlines. <code>\r\n</code> wird daher von nichts gematched, und das matching von <code>$</code> schlägt fehl, weil die Implementierungen nicht den Multiline Modus annehmen. Das wird momentan von <a href="http://cplusplus.github.io/LWG/lwg-active.html#2343" rel="nofollow">LWG 2343</a> behandelt. Deren Information ist stimmig: Boost hat Multiline standardmäßig aktiviert, und <a href="http://coliru.stacked-crooked.com/a/7b80be308a129ffb" rel="nofollow">matched deinen zweiten String ebenfalls</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2490282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2490282</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Mon, 14 Mar 2016 11:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to Frage zu RegEx on Mon, 14 Mar 2016 12:15:35 GMT]]></title><description><![CDATA[<p>ok danke euch. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /> Ich geh mal den Schalter suchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";-)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2490284</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2490284</guid><dc:creator><![CDATA[It0101]]></dc:creator><pubDate>Mon, 14 Mar 2016 12:15:35 GMT</pubDate></item></channel></rss>