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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:42:34+00:00 2026-06-02T16:42:34+00:00

My problem is the [,\s|,|\s] will match , as , and leave a extra

  • 0

My problem is the [,\s|,|\s] will match “, ” as “,” and leave a extra space

So I do not get a match “Sat, Mon” with:

(Thu|Fri|Sat)[,\s|,|\s](Mon|Tue)

By matching on (Thu|Fri|Sat)[,\s|,|\s]
I get a match on “Sat, ” but the match.Value is on “Sat,” (no space)

Basically I want to also get a match on “Sat,Mon” “Sat, Mon” “Sat Mon” but not “SatMon”

Thanks

  • 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-02T16:42:36+00:00Added an answer on June 2, 2026 at 4:42 pm
    (Thu|Fri|Sat)[,\s]\s*(Mon|Tue)
    

    This will allow comma or space and any additional space before Mon or Tue

    Your version was conflating the notions of character classes and alternation. Alternation, where you separate options with | must be inside of parentheses. We can make these parentheses non-capturing using the (?: ) syntax.

    Above, I used a character class. To use alternation:

    (Thu|Fri|Sat)(?:,|\s)\s*(Mon|Tue)
    

    I have used \s to denote whitespace, but for your purposes you could replace them with a literal space.

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

Sidebar

Related Questions

Search for: 'chemist' Problem: query which will match a string like 'onechemist' but not
The following regular expression will match Saturday or Sunday : (?:(Sat)ur|(Sun))day But in one
In PHP I have a function, the problem is it will output an extra
Okay, so the answer to my question might not be the problem but here's
I need to write a regex which will match URLs that do not have
When I use make command, like make mica2, in TinyOS. The following problem will
I have a problem and I will try to explain the issue: I have
This is kind of a oddball problem so I will try to describe the
Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial.
I will demonstrate the problem on a real example so the situation: there is

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.