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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:37:10+00:00 2026-05-22T11:37:10+00:00

I wanted to do some regular expressions in C++ so I looked on the

  • 0

I wanted to do some regular expressions in C++ so I looked on the interwebz (yes, I am an beginner/intermediate with C++) and found this SO answer.

I really don’t know what to choose between boost::regex and boost::xpressive. What are the pros/cons?

I also read that boost::xpressive opposed to boost::regex is a header-only library. Is it hard to statically compile boost::regex on Linux and Windows (I almost always write cross-platform applications)?

I’m also interested in comparisons of compile time. I have a current implementation using boost::xpressive and I’m not too content with the compile times (but I have no comparisons to boost::regex).

Of course I’m open for other suggestions for regex implementations too. The requirements are free (as in beer) and compatible with http://nclabs.org/license.php.

  • 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-22T11:37:11+00:00Added an answer on May 22, 2026 at 11:37 am

    Well if you need to create a regular expression at runtime (i.e. Letting the user type in a regular expression to search for) you can’t use xpressive as it is compile time only.

    On the other hand, since it is a compile-time construct, it should benefit more from your optimizer than regex does.

    I do enough stuff with Boost.MPL, StateChart, and Spirit that 220KB of compiler warning and errors don’t really bother me much. If that sounds like hell to you, stick with Boost.Regex.

    If you do use xpressive, I highly recommend turning on -Wfatal-errors as this will stop compilation (and further errors) after the first ‘error:’ line.

    For compilation time, it’s no contest. Boost.Regex will be faster*. The fact that xpressive uses MPL will cause compile times to be dramatically increased.

    *This assumes you only build the dll/so once

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

Sidebar

Related Questions

I am really really bad at regular expression, I don't know why but I
I know the topic I started is too subjective. But I just wanted some
This is going to be a quick discussion, but I just wanted some feedback
First, I confess I'm not realy experimented with regular expressions. I know how use
Just wanted some quick help I'm 90% sure i need to use the (this)
I would like to learn ASP.NET and just wanted some input as to which
I wanted to make some simple file recovery software, where I want to try
Just wanted to write some recursion but can't check if the child is in
I wanted to create some subdirectories inside my blob. But it is not working
I wanted to add some analytics functionnalities to my app so I created an

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.