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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:26:18+00:00 2026-06-10T21:26:18+00:00

Suppose I wanted to create a boost.regex expression that would match strings such as

  • 0

Suppose I wanted to create a boost.regex expression that would match strings such as

“repetitions: 5 aaaaa”
“repetitions: 3 aaa”

Is there a way to do this with boost?

  • 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-10T21:26:20+00:00Added an answer on June 10, 2026 at 9:26 pm

    I haven’t used boost::regex in particular, but the regular expression you’re asking for is straight-forward. Looking through the boost::regex docs, it looks like you’d do something similar to this:

    boost::regex e("repetitions:\\s+\\d\\s+[a-zA-Z]+");
    

    (double slashes are so the escape sequences aren’t swallowed by the compiler)

    Note:
    If you’re also trying to validate that the first number matches the number of letter ‘a’, that won’t work with just a regular expression. Regexes only match characters, without any clue as to what they mean, so ‘5’ and ‘3’ are not seen in any numerical way. Look at their docs on Captures. You’ll want to get the number as a string, lexical_cast it to an integer, and use that to validate the aaaaa part.

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

Sidebar

Related Questions

Suppose I wanted to create a WCF WebHTTP service (ServiceREST) that had a reference
I am aware that one can create template filters in Django templates such as
Suppose I wanted to create an open source Windows Forms project written in .NET.
Let's just say for argument's sake that you wanted to create a PowerShell Cmdlet
Suppose I only had the regular J2SE http libraries but wanted to write a
I wanted to show a vertical drop-down menu on click on a div. Suppose
Suppose I have a pure virtual method in the base interface that returns to
Suppose I have a static method of my class that returns an object of
Suppose I have a class Baz that inherits from classes Foo and Bar ,
Suppose I have a simple model, such as Record: @Model public class Record {

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.