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

  • SEARCH
  • Home
  • 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 7161239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:32:01+00:00 2026-05-28T13:32:01+00:00

I am toying around with Boost Xpressive and am having trouble with the following

  • 0

I am toying around with Boost Xpressive and am having trouble with the following snippet

#include <iostream>
#include <string>
#include <boost/xpressive/xpressive.hpp>

using namespace std;
using namespace boost::xpressive;

int main()
{
    string s("123");
    sregex rex = _d;
    rex >>= _d;

    smatch what;

    regex_search(s, what, rex);

    cout << "Match: " << what[0] << endl;

    return 0;
 }

The result of running this program is a match of 1 as opposed to the expected 12. Does the sregex::operator>>= have a different meaning/use what I intuitively assumed? I was expecting this to yield an sregex similar to _d >> _d.

  • 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-28T13:32:02+00:00Added an answer on May 28, 2026 at 1:32 pm

    Xpressive doesn’t support the >>= operator. The fact that this code compiles at all could be considered a bug. Try:

    rex = rex >> _d;
    

    However, building up a regex piecemeal like this will make the regex perform poorly.

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

Sidebar

Related Questions

I'm trying to have CMake 2.8.6 link to boost::program_options using the following code in
I'm trying to generate random numbers with boost, and I'm having trouble getting it
I was toying around with the idea of using dynamically loading BPL's and passing
I've been toying around with the Steam Web API using JSON format. I've been
I'm toying around with the Facebook APIs for a game I'm developing as a
Right now I am toying around with an idea in my head, and have
I've been toying around with switching from ms-access files to SQLite files for my
I'm toying around with GWT (dunno if this matters) and Hibernate. I've created a
I'm currently toying around with the Clarity .NET Facebook API but am finding certain
I'm toying around with fluent interfaces in the style of Martin Fowlers text, and

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.