Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The basic problem is that you are using <code>regex_match</code> when you should be using <code>regex_search</code>:</p> <blockquote> <p>The algorithms regex_search and regex_match make use of match_results to report what matched; the difference between these algorithms is that regex_match will only find matches that consume all of the input text, where as regex_search will search for a match anywhere within the text being matched.</p> </blockquote> <p><a href="http://www.boost.org/doc/libs/1_39_0/libs/regex/doc/html/boost_regex/introduction_and_overview.html" rel="noreferrer">From the boost documentation</a>. Change it to use <code>regex_search</code> and it will work.</p> <p>Also, it looks like you are not capturing the matches. Try changing the regex to this:</p> <pre><code>regex re("(\\d*)"); </code></pre> <p>Or, maybe you need to be calling <code>regex_search</code> repeatedly:</p> <pre><code>char *where = s.c_str(); while (regex_search(s.c_str(), matches, re)) { where = m.suffix().first; } </code></pre> <p>This is since you only have one capture in your regex.</p> <p>Alternatively, change your regex, if you know the basic structure of the data:</p> <pre><code>regex re("(\\d+).*?(\\d+)"); </code></pre> <p>This would match two numbers within the search string.</p> <p>Note that the regular expression \d* will match zero or more digits - this includes the empty string "" since this is exactly zero digits. I would change the expression to \d+ which will match 1 or more.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload