Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8981199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:16:26+00:00 2026-06-15T20:16:26+00:00

Possible Duplicate: Is gcc4.7 buggy about regular expressions? I compile the code below with

  • 0

Possible Duplicate:
Is gcc4.7 buggy about regular expressions?

I compile the code below with “g++ test.cpp -std=gnu++0x” .
Compilation is successful but when I run./a.out it gives error like that I do not understand why it happens. My operating system s Mint.

Error:
”
terminate called after throwing an instance of ‘std::regex_error’
what(): regex_error
Aborted (core dumped)
“

Code:
// regex_match example
#include <iostream>
#include <string>
#include <regex>

using namespace std;

int main ()
{
  string s ("this subject has a submarine as a subsequence");
  regex e("sub[a-z]");   // matches words beginning by "sub"
  smatch m;

  return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T20:16:28+00:00Added an answer on June 15, 2026 at 8:16 pm

    The code looks fine. GCC’s implementation of regex is unusable. Don’t waste your time with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Struct Padding The program is as below: #include <iostream> using namespace std;
Possible Duplicate: Eclipse CDT C++11/C++0x support I tried everything to compile C++11 code namely
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: std::string x(x); class A {}; int main() { A a(a); } This
Possible Duplicate: c++ why initializer_list behavior for std::vector and std::array are different I defined
Possible Duplicate: Can you write object oriented code in C? Hi, can someone point
Possible Duplicate: gcc-4.2 failed with exit code 1 iphone Can anybody tell what does
Possible Duplicate: casting unused return values to void I read some source code, and
Possible Duplicate: std::bind a bound function void foo0(int val) { std::cout << val <<
Possible Duplicate: Error calling template method in templated-base-class The following code compiles with MSVC10

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.