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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:40:07+00:00 2026-06-11T20:40:07+00:00

I have a regular expression below that works for a string example like: MCCOY

  • 0

I have a regular expression below that works for a string example like:

  • MCCOY 3H L24 FINAL 02-28-2012.dwg or
  • SMITH-JOHNSON 5H R32 FINAL 05-26-2012.dwg

But now I’m trying to figure out how to change the regular expression to work for the examples above if they were like:

  • MCCOY 3H L-ABC FINAL 02-28-2012.dwg or
  • SMITH-JOHNSON 5H R-123 FINAL 05-26-2012.dwg

They can also be like

  • MCCOY 3H L-C2 FINAL 02-28-2012.dwg or
  • SMITH-JOHNSON 5H R-2 FINAL 05-26-2012.dwg

So to sum this up, that middle section will always have a Alphabetic character followed by a Dash and then it could have as much as 3 numbers or alphabetic characters or as few as 1 number or alphabetic character.

"^[a-z]+(?:[ -][a-z]+)*\s+\d+[a-z]\s+[a-z]\d+\s+[a-z]+\s+\d{2}-\d{2}-\d{4}\.dwg$"
  • 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-11T20:40:08+00:00Added an answer on June 11, 2026 at 8:40 pm
    \w{1,3}
    

    matches 1 to 3 alphanumeric characters.

    http://msdn.microsoft.com/en-us/library/az24scfc.aspx#quantifiers

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

Sidebar

Related Questions

I would like to ask you about regular expressions preg_match have outlined below. I
I have a regular expression to validate the dates and it works fine, this
I have this Regular Expression that matches the following strings: <!-- 09-02-2009 ---> <!--
i have simple regular expression: ^123$ Matches are for example 123 1234 etc. How
I have a regular expression ( \d{4}\w{3}(0[1-9]|[12][0-9]|3[01])([01][0-9]|2[0-3])([0-5][0-9]){2} ) that I need to validate the
What do I have to change in this regular expression so that in both
I want to have the regular expression that makes sure the beginning of the
I have a String like below: <script language=JavaScript type=text/javascript src=http://dns.net/adj/myhost.com/index;size=5x10;zipc=12345;myzon=north_west;|en;tile=10;ord=7jkllk456?></script> I want to access
I have a very basic regular expression that I just can't figure out why
I am trying to write a regular expression that will match a string that

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.