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 7568701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:59:25+00:00 2026-05-30T14:59:25+00:00

I am using the boost regex library in my code. I have a simple

  • 0

I am using the boost regex library in my code. I have a simple application that compiles and runs correctly on a machine that is running Fedora. When I compile the same code on SUSE linux, all but the first submatch string is empty.

The code is as follows

const string pattern = "(abc)(def)"; 
const string target = "abcdef";

boost::regex regexPattern(pattern, boost::regex::extended);
boost::smatch what;

bool isMatchFound = boost::regex_match(target, what, regexPattern);
if (isMatchFound)
{
    for (unsigned int i=0; i < what.size(); i++)
    {
        cout << "WHAT " << i << " " << what[i] << endl;
    }
}

The output on fedora is the following

WHAT 0 abcdef
WHAT 1 abc
WHAT 2 def

The output on SUSE is the following

WHAT 0 abcdef
WHAT 1 
WHAT 2 

I cannot seem to find any reference to a similar problem anywhere. I assume there is a simple fix, but I havent been able to find it despite days of scouring the web.

The compilers have the following versions.

Fedora : g++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)
SUSE : g++ (GCC) 4.1.2 20070115 (SUSE Linux)

I am using Boost version 1.48.0 in both cases. I don’t have root on either machine.

  • 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-05-30T14:59:27+00:00Added an answer on May 30, 2026 at 2:59 pm

    Updating the compiler to a later version fixed the issue. I am suprised compiling boost with the older 4.1 compiler silently broke the submatch functionality on that SUSE box.

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

Sidebar

Related Questions

I have imported Boost library in to a .dll that I am using. I
I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor
This is my code: #include <string> #include <boost/algorithm/string/regex.hpp> string f(const string& s) { using
I have a chunk of text like: Name=Long John Silver;Profession=cook;Hobby=Piracy And using the Boost::regex
Given this code: #include <iostream> #include <vector> #include <fstream> #include <sstream> #include <boost/regex.hpp> using
I'm having a problem using the Boost library in Dev C++, specifically the regex
I understand that boost regex static library is created with the ar utility by
I'm trying to get all words inside a string using Boost::regex in C++. Here's
I have just started using Boost 1.36. These libraries would be very useful in
I'm new in using boost and have a problem. I need shared_mutex function in

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.