<?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[Probleme mit Boost Regex Iteratoren]]></title><description><![CDATA[<p>Hallo liebe Codergemeinschaft,</p>
<p>Ich kämpfe seit Tagen mit den Iteratoren bei der regex_search Funktion. Ich hab den Beispiel Code aus dem Internet übernohmen und weiß einfach nicht mehr was ich machen soll. Also könnt ihr mal über den Code schauen ?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;boost/regex.hpp&gt;
#include &lt;fstream&gt;

using namespace std;
const int BUFSIZE = 10000;

int main(int argc, char** argv) {

   // Safety checks omitted...
   boost::regex re(&quot;&lt;a\\s+href=\&quot;([\\-:\\w\\d\\.\\/]+)\&quot;&gt;&quot;);
   string file(argv[1]);
   char buf[BUFSIZE];
   //boost::cmatch matches;
   string sbuf;
   string::const_iterator begin, end;
   ifstream in(file.c_str());
   boost::match_results&lt;std::string::const_iterator&gt; matches;
   boost::match_flag_type flags = boost::match_default|boost::match_partial;

   while (!in.eof())
   {
      in.getline(buf, BUFSIZE-1);
      sbuf = buf;
      begin = sbuf.begin();
      end = sbuf.end();

      while (boost::regex_search(begin, end, matches, re, flags))
      {
         string url(matches[1].first, matches[1].second);
         cout &lt;&lt; &quot;URL: &quot; &lt;&lt; url &lt;&lt; endl;
         // Update the beginning of the range to the character
         //following the match
         begin = matches[1].second;
      }
   }
}
</code></pre>
<p>Schonmal Danke im Voraus.</p>
<p>MFG seennoob</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/258222/probleme-mit-boost-regex-iteratoren</link><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 12:06:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/258222.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jan 2010 23:12:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Thu, 07 Jan 2010 23:12:41 GMT]]></title><description><![CDATA[<p>Hallo liebe Codergemeinschaft,</p>
<p>Ich kämpfe seit Tagen mit den Iteratoren bei der regex_search Funktion. Ich hab den Beispiel Code aus dem Internet übernohmen und weiß einfach nicht mehr was ich machen soll. Also könnt ihr mal über den Code schauen ?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;boost/regex.hpp&gt;
#include &lt;fstream&gt;

using namespace std;
const int BUFSIZE = 10000;

int main(int argc, char** argv) {

   // Safety checks omitted...
   boost::regex re(&quot;&lt;a\\s+href=\&quot;([\\-:\\w\\d\\.\\/]+)\&quot;&gt;&quot;);
   string file(argv[1]);
   char buf[BUFSIZE];
   //boost::cmatch matches;
   string sbuf;
   string::const_iterator begin, end;
   ifstream in(file.c_str());
   boost::match_results&lt;std::string::const_iterator&gt; matches;
   boost::match_flag_type flags = boost::match_default|boost::match_partial;

   while (!in.eof())
   {
      in.getline(buf, BUFSIZE-1);
      sbuf = buf;
      begin = sbuf.begin();
      end = sbuf.end();

      while (boost::regex_search(begin, end, matches, re, flags))
      {
         string url(matches[1].first, matches[1].second);
         cout &lt;&lt; &quot;URL: &quot; &lt;&lt; url &lt;&lt; endl;
         // Update the beginning of the range to the character
         //following the match
         begin = matches[1].second;
      }
   }
}
</code></pre>
<p>Schonmal Danke im Voraus.</p>
<p>MFG seennoob</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834756</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834756</guid><dc:creator><![CDATA[seennoob]]></dc:creator><pubDate>Thu, 07 Jan 2010 23:12:41 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Thu, 07 Jan 2010 23:17:10 GMT]]></title><description><![CDATA[<p>Hab den Code angeschaut. Sehr schön.</p>
<blockquote>
<p>Ich hab den Beispiel Code aus dem Internet übernohmen und weiß einfach nicht mehr was ich machen soll.</p>
</blockquote>
<p>Kompilieren? Ausführen?</p>
<p>Wo genau liegt das Problem?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834758</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Thu, 07 Jan 2010 23:17:10 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Thu, 07 Jan 2010 23:27:48 GMT]]></title><description><![CDATA[<p>Beim compilieren</p>
<p>siehe Fehlermeldungen:<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>boost::basic\_regex&lt;char, boost::regex\_traits&lt;char, boost::cpp\_regex\_traits&lt;char&gt; &gt; &gt;::assign(char const*, char const*, unsigned int)': /usr/include/boost/regex/v4/basic\_regex.hpp:262: undefined reference to</code>boost::basic_regex&lt;char, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::do_assign(char const*, char const*, unsigned int)'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>perl_matcher': /usr/include/boost/regex/v4/perl\_matcher.hpp:347: undefined reference to</code>boost::re_detail::perl_matcher&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::construct_init(boost::basic_regex&lt;char, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt; const&amp;, boost::regex_constants::_match_flags)'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>bool boost::regex\_search&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub\_match&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, char, boost::regex\_traits&lt;char, boost::cpp\_regex\_traits&lt;char&gt; &gt; &gt;(\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, \_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, boost::match\_results&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub\_match&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt;&amp;, boost::basic\_regex&lt;char, boost::regex\_traits&lt;char, boost::cpp\_regex\_traits&lt;char&gt; &gt; &gt; const&amp;, boost::regex\_constants::\_match\_flags, \_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;)': /usr/include/boost/regex/v4/regex\_search.hpp:56: undefined reference to</code>boost::re_detail::perl_matcher&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::find()'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>boost::cpp\_regex\_traits&lt;char&gt;::transform(char const*, char const*) const': /usr/include/boost/regex/v4/cpp\_regex\_traits.hpp:888: undefined reference to</code>boost::re_detail::cpp_regex_traits_implementation&lt;char&gt;::transform(char const*, char const*) const'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>boost::cpp\_regex\_traits&lt;char&gt;::transform_primary(char const*, char const*) const': /usr/include/boost/regex/v4/cpp\_regex\_traits.hpp:892: undefined reference to</code>boost::re_detail::cpp_regex_traits_implementation&lt;char&gt;::transform_primary(char const*, char const*) const'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>save\_state\_init': /usr/include/boost/regex/v4/perl\_matcher\_non\_recursive.hpp:107: undefined reference to</code>boost::re_detail::get_mem_block()'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>boost::re\_detail::perl\_matcher&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub\_match&lt;\_\_gnu\_cxx::\_\_normal\_iterator&lt;char const*, std::basic\_string&lt;char, std::char\_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex\_traits&lt;char, boost::cpp\_regex\_traits&lt;char&gt; &gt; &gt;::match_match()': /usr/include/boost/regex/v4/perl\_matcher\_common.hpp:479: undefined reference to</code>boost::match_results&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt;::maybe_assign(boost::match_results&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt; &gt; const&amp;)'<br />
build/Debug/GNU-Linux-x86/main.o: In function <code>boost::re\_detail::cpp\_regex\_traits\_implementation&lt;char&gt;::error\_string(boost::regex\_constants::error_type) const': /usr/include/boost/regex/v4/cpp\_regex\_traits.hpp:436: undefined reference to</code>boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'<br />
/usr/include/boost/regex/v4/cpp_regex_traits.hpp:438: undefined reference to <code>boost::re\_detail::get\_default\_error\_string(boost::regex\_constants::error\_type)' build/Debug/GNU-Linux-x86/main.o: In function</code>void boost::re_detail::raise_error&lt;boost::regex_traits_wrapper&lt;boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt; &gt;(boost::regex_traits_wrapper&lt;boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt; const&amp;, boost::regex_constants::error_type)':<br />
/usr/include/boost/regex/pattern_except.hpp:75: undefined reference to <code>boost::re\_detail::raise\_runtime\_error(std::runtime_error const&amp;)' build/Debug/GNU-Linux-x86/main.o: In function</code>boost::re_detail::perl_matcher&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::extend_stack()':<br />
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:197: undefined reference to <code>boost::re\_detail::get\_mem\_block()' build/Debug/GNU-Linux-x86/main.o: In function</code>boost::re_detail::perl_matcher&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::unwind_extra_block(bool)':<br />
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:978: undefined reference to <code>boost::re\_detail::put\_mem\_block(void*)' build/Debug/GNU-Linux-x86/main.o: In function</code>~save_state_init':<br />
/usr/include/boost/regex/v4/perl_matcher_non_recursive.hpp:115: undefined reference to <code>boost::re\_detail::put\_mem\_block(void*)' build/Debug/GNU-Linux-x86/main.o: In function</code>boost::re_detail::perl_matcher&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;boost::sub_match&lt;__gnu_cxx::__normal_iterator&lt;char const*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; &gt;, boost::regex_traits&lt;char, boost::cpp_regex_traits&lt;char&gt; &gt; &gt;::find_imp()':<br />
/usr/include/boost/regex/v4/perl_matcher_common.hpp:290: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'</p>
<p>Entschuldigt bitte das ich das Forum mit dem &quot;verstopfe&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834763</guid><dc:creator><![CDATA[seennoob]]></dc:creator><pubDate>Thu, 07 Jan 2010 23:27:48 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Thu, 07 Jan 2010 23:47:08 GMT]]></title><description><![CDATA[<p>Hast du die libs überhaupt? regex ist nicht Header Only, dass heisst, dass du Libs selbst builden musst, oder fertige binarys laden musst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834768</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Thu, 07 Jan 2010 23:47:08 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Thu, 07 Jan 2010 23:58:07 GMT]]></title><description><![CDATA[<p>Meines wissens ja<br />
Eine normale Suche ohne Iteratoren funktioniert problemlos.</p>
<p>MFG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834770</guid><dc:creator><![CDATA[seennoob]]></dc:creator><pubDate>Thu, 07 Jan 2010 23:58:07 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Boost Regex Iteratoren on Fri, 08 Jan 2010 10:40:17 GMT]]></title><description><![CDATA[<p>Linkst du sie auch mit?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1834887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1834887</guid><dc:creator><![CDATA[Blue-Tiger]]></dc:creator><pubDate>Fri, 08 Jan 2010 10:40:17 GMT</pubDate></item></channel></rss>