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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:01:20+00:00 2026-05-16T06:01:20+00:00

Pretty much what the question says. I came up with (ba)?(a + bb +

  • 0

Pretty much what the question says. I came up with

(ba)?(a + bb + bbbbb + aba)*(ab)?

Is there anything more readable? Or is this incorrect?
I know you shouldn’t really be doing this sorta thing with Regex when you can just go !~/bbb/ in your code, but it’s a theory exercise.

Thanks.

Edit for Clarification: I’m not using | to represent the OR bit in the Regex and using + it instead. Sorry for the confusion.

Edit 2: {a,b} is for a language with just ‘a’ and ‘b’ characters. Not {mininum, maximum}. Sorry again.

Edit 3: Because this is part of a theory class, we’re just dealing with the basics of Regex. The only things you’re allowed to use are +, ?, () and *. You cannot use {minimum, maximum).

  • 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-16T06:01:20+00:00Added an answer on May 16, 2026 at 6:01 am

    I think I have a working regex. Let b°—which is a notation I invented just now—be the regex that matches zero or more b’s, except it won’t match three of them. This can be replaced by (ε | b | bb | bbbb+), so don’t worry that I’m using magic or anything. Now I think that matching strings can be seen as repeating subpatterns of zero or more a’s followed by b°, which could be (a*b°)*, but you need there to be at least one “a” in between sequences of b’s. So your final regex is a*b°(a+b°)*.

    Since b° can match the empty string, the initial a* is superfluous as the a+ can pick up the initial a’s just fine, so the regex can be optimized down to b°(a+b°)* (thanks, wrikken).

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

Sidebar

Related Questions

Pretty much what the question says. What's the difference between the two classes of
This is a pretty-much theoretical question, but.. How much of an operating system could
This question is pretty much the same as this .Net question exept for java.
Pretty much as the question says, I have some code running on an interval:
The question says pretty much everything. My point is, is the user able to
The question pretty much says it all, I've tried setting the backcolour to transparent
The question pretty much says it all, but I'm building a compiler and am
The question pretty much says it all, I've been looking around for an answer
The question pretty much says it all. I have an app with an older
The question pretty much already says everything. I'm starting to add some features to

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.