<?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[nachricht parsen]]></title><description><![CDATA[<p>hi<br />
wie kann ich eine nachricht parsen. hab absolut keine ahnung davon.<br />
jemand n link zum tutorial oder weiß jemand wie es geht?<br />
gruß<br />
ebrosius</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/123972/nachricht-parsen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 18:26:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123972.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 21 Oct 2005 21:02:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to nachricht parsen on Fri, 21 Oct 2005 21:02:58 GMT]]></title><description><![CDATA[<p>hi<br />
wie kann ich eine nachricht parsen. hab absolut keine ahnung davon.<br />
jemand n link zum tutorial oder weiß jemand wie es geht?<br />
gruß<br />
ebrosius</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898265</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898265</guid><dc:creator><![CDATA[ebrosius]]></dc:creator><pubDate>Fri, 21 Oct 2005 21:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Fri, 21 Oct 2005 21:14:49 GMT]]></title><description><![CDATA[<p>Dein Beitrag ist zu allgemein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898283</guid><dc:creator><![CDATA[..............]]></dc:creator><pubDate>Fri, 21 Oct 2005 21:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Fri, 21 Oct 2005 21:22:41 GMT]]></title><description><![CDATA[<p>also ich habe einen bot für irc chat geschrieben. der kann jetzt auf nachrichten antworten. allerdings muss ich ihm die komplette nachricht die der server übermittelt übergeben. muss also die servernachricht auseinander nehmen, um nur den text den der user schreibt zu übergeben.<br />
bsp:<br />
server: :username!blabbla ... PRIVMSG #channel : hi<br />
muss das &quot;hi&quot; nur rausfiltern</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898291</guid><dc:creator><![CDATA[ebrosius]]></dc:creator><pubDate>Fri, 21 Oct 2005 21:22:41 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Fri, 21 Oct 2005 21:45:09 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>nimm z.B. std::string und nutzt die Methoden, um das unpassende rauszufiltern.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898308</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898308</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Fri, 21 Oct 2005 21:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Sat, 22 Oct 2005 06:33:16 GMT]]></title><description><![CDATA[<p>hmmm...das sagt mir jetzt auf anhieb erstmal garnichts</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898434</guid><dc:creator><![CDATA[ebrosius]]></dc:creator><pubDate>Sat, 22 Oct 2005 06:33:16 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Sat, 22 Oct 2005 06:40:09 GMT]]></title><description><![CDATA[<p>im allgemeinen ist parsen recht kompliziert, aber in deinem fall scheint die lösung einfacher zu sein: nach dem ersten vorkommnis von &quot;#channel:&quot; suchen und den text dahinter extrahieren:</p>
<pre><code class="language-cpp">#include&lt;string&gt;
#include&lt;algorithm&gt;

using namespace std;

string
extract_word (const string &amp;str, int pos=0)
// extrahiere wort ab position pos
// führende leerzeichen werden übersprungen
{
  // führende leerzeichen überspringen
  int start=str.find_first_not_of(&quot; &quot;,pos);
  if(start==string::npos) start=msg.size();

  // wortende finden
  int end=str.find_first_of(&quot; &quot;,start);
  if(end==string::npos) end=msg.size();

  // wort kopieren
  string word(end-start);
  copy(str.begin()+start,str.begin()+end,word.begin());

  return word;
}

string
extract_field (const string &amp;msg, const string &amp;key)
// extrahiere wort, daß auf das schlüsselwort key folgt
// gibt &quot;&quot; zurück, falls key nicht in msg vorkommt
{
  string word;
  int start=msg.find(key);
  if(start!=string::npos) // schlüsselwort gefunden
    word=extract_word(msg,start+key.size());

  return word;
}

string
extract_channel (const string &amp;msg)
{
  return extract_field(msg,&quot;#channel :&quot;);
}
</code></pre>
<p>ob der code tatsächlich funktioniert hängt von der syntax der message im detail ab. und die kenn ich leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898436</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898436</guid><dc:creator><![CDATA[Konfusius]]></dc:creator><pubDate>Sat, 22 Oct 2005 06:40:09 GMT</pubDate></item><item><title><![CDATA[Reply to nachricht parsen on Sat, 22 Oct 2005 06:55:09 GMT]]></title><description><![CDATA[<p>das sieht doch schonmal sehr gut aus.<br />
dank dir konfusius. muss jetzt erstmal arbeiten gehn. heut abend probier ich das mal aus.<br />
thx</p>
]]></description><link>https://www.c-plusplus.net/forum/post/898440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/898440</guid><dc:creator><![CDATA[ebrosius]]></dc:creator><pubDate>Sat, 22 Oct 2005 06:55:09 GMT</pubDate></item></channel></rss>