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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:03:58+00:00 2026-06-04T14:03:58+00:00

I need some help in evaluating a regular expression in some code.I am trying

  • 0

I need some help in evaluating a regular expression in some code.I am trying to evaluate the regular expression

/^\s*(\*|[\w\-]+)(?:\b|$)?/i

I think I figured the following:

^ – Beginning of character

\s* – zero or more occurrences of white space

(\*|[\w\-]+) – I understand the \w standards for word but I am not sure what \* and the or | is evaluating to and the + specifies one more more occurrence of the preceding pattern.

(?:\b|$)? – I need help in understanding this and the expression as a whole.

i – Ignore case

Can some help me understand what (?:\b|$)? is evaluating for and the expression as whole? Any help would be appreciated.

  • 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-04T14:03:59+00:00Added an answer on June 4, 2026 at 2:03 pm
    /                # Start regex delimiter.
    ^                # Anchor to start of string.
    \s*              # Match 0 or more whitespace (\s) characters.
    (\*|[\w\-]+)     # Alternation between a literal `*` and one or more word
                     # characters (\w) or a dash (needlessly escaped). Store in
                     # capturing group 1.
    (?:\b|$)?        # Create a non capturing alternation between a word boundary
                     # or the end of the string. This entire alternation is 
                     # optional.
    /                # End regex delimiter.
    i                # Make the regex case insensitive. Needless here as there is 
                     # no literal alphabetical characters used.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help, I have a regular expression that appears to work just fine
need some help! I'm trying to write some code in objective-c that requires part-of-speech
Need some help with a regular expression How can I write an expression that
Need some help with what is probably a pretty basic SQL query. I'm trying
Need some help refactoring this code: $(span[rel=color_content]).ColorPicker({ onChange: function (hsb, hex, rg) { $(span[rel=color_content]).css('background-color',
Need some help with extracting 2 pieces of information from the following string: viewed
need some help. I need to count regular working days for a given date
Need some help. This javascript code should set the target of the form and
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview

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.