Language: C++

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int main() {
  string s;
  cin >> s;

  if (regex_match(s), regex("(dream(er)?|(erase(r)?))*"))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: no matching function for call to 'regex_match(std::string&)'
   18 |   if (regex_match(s), regex("(dream(er)?|(erase(r)?))*"))
      |       ~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:1:
/usr/include/c++/14/bits/regex.h:2261:5: note: candidate: 'template<class _Bi_iter, class _Alloc, class _Ch_type, class _Rx_traits> bool std::regex_match(_Bi_iter, _Bi_iter, __cxx11::match_results<_BiIter, _Alloc>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type)'
 2261 |     regex_match(_Bi_iter                                 __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2261:5: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2288:5: note: candidate: 'template<class _Bi_iter, class _Ch_type, class _Rx_traits> bool std::regex_match(_Bi_iter, _Bi_iter, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2288 |     regex_match(_Bi_iter __first, _Bi_iter __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2288:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2313:5: note: candidate: 'template<class _Ch_type, class _Alloc, class _Rx_traits> bool std::regex_match(const _Ch_type*, __cxx11::match_results<const _Ch_type*, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2313 |     regex_match(const _Ch_type* __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2313:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2337:5: note: candidate: 'template<class _Ch_traits, class _Ch_alloc, class _Alloc, class _Ch_type, class _Rx_traits> bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&, __cxx11::match_results<typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2337 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>& __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2337:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2351:5: note: candidate: 'template<class _Ch_traits, class _Ch_alloc, class _Alloc, class _Ch_type, class _Rx_traits> bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&&, __cxx11::match_results<typename __cxx11::basic_string<_Ch_type, _Ch_traits, _Ch_alloc>::const_iterator, _Alloc>&, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)' (deleted)
 2351 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Ch_alloc>&&,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2351:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2373:5: note: candidate: 'template<class _Ch_type, class _Rx_traits> bool std::regex_match(const _Ch_type*, const __cxx11::basic_regex<_Ch_type, _Rx_traits>&, regex_constants::match_flag_type)'
 2373 |     regex_match(const _Ch_type* __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2373:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/regex.h:2395:5: note: candidate: 'template<class _Ch_traits, class _Str_allocator, class _Ch_type, class _Rx_traits> bool std::regex_match(const __cxx11::basic_string<_Ch_type, _Ch_traits, _Str_allocator>&, const __cxx11::basic_regex<_CharT, _TraitsT>&, regex_constants::match_flag_type)'
 2395 |     regex_match(const basic_string<_Ch_type, _Ch_traits, _Str_allocator>& __s,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/regex.h:2395:5: note:   candidate expects 2 arguments, 1 provided