A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/regex/regex_iterator/operator!=/ below:

public member function

<regex>

std::regex_iterator::operator!=
bool operator!=(const regex_iterator& rhs) const;

Compare regex_iterator for inequality

Returns true if rhs does not compare equal to the regex_iterator object.

Two regex_iterator compare equal if any of these is true:



Parameters
rhs
Another regex_iterator object of the same type.

Return valuetrue if both regex_iterator do not compare equal. false otherwise.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// regex_iterator example
#include <iostream>
#include <string>
#include <regex>

int main ()
{
  std::string s ("this subject has a submarine as a subsequence");
  std::regex e ("\\b(sub)([^ ]*)");   // matches words beginning by "sub"

  std::regex_iterator<std::string::iterator> rit ( s.begin(), s.end(), e );
  std::regex_iterator<std::string::iterator> rend;

  while (rit!=rend) {
    std::cout << rit->str() << std::endl;
    ++rit;
  }

  return 0;
}

Output:
subject
submarine
subsequence

See also
regex_iterator::regex_iterator
Construct regex_iterator (public member function)
regex_iterator::operator==
Compare regex_iterator (public member function)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4