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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:43:14+00:00 2026-06-09T12:43:14+00:00

^(?:(2\d\d\d)\s+)?(?:Comm\. Rep\.\s+)?(?:CONG\s+)?(\S+)\s+(\S+)\s+(?:No\.\s+)?(\S+)(?:\s+\(.*?\))?$ Currently this is able to parse a string like 2009 IA H.B.

  • 0
"^(?:(2\d\d\d)\s+)?(?:Comm\. Rep\.\s+)?(?:CONG\s+)?(\S+)\s+(\S+)\s+(?:No\.\s+)?(\S+)(?:\s+\(.*?\))?$"

Currently this is able to parse a string like

2009 IA H.B. 184 (NS)

How can I make it parse a text like

2009 IA HEART RATE 184 (NS)

I’m looking for a tweak that’ll make it parse the spaced word HEART RATE.

EDIT:
It seems to work as long as the third word is not spaced out. Like for e.g.
It works for 2009 IA REG 184 (NS) … But as soon as the third word is actually made of spaces it goes out of whack like HEART RATE for example.

  • 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-09T12:43:16+00:00Added an answer on June 9, 2026 at 12:43 pm

    I’m going to make the assumption that you want all those space separated words, which doesn’t work right now because you are trying to read the “third word” (the second regex capture group) HEART RATE by just reading until you find a space (the second (\S+)).

    To fix this, I’ll assume you the “third word” is all the space separated words until you hit a number or a word starting with No. (tell me if this assumption is wrong!). This is the ((?:\S|\s(?!\d|No\.))+) in the solution.

    Here is my solution:

    "^(?:2\d{3}\s+)?(?:Comm\. Rep\.\s+)?(?:CONG\s+)?(\S+)\s+((?:\S|\s(?!\d|No\.))+)\s+(?:No\.\s+)?(\S+)(?:\s+\(.*?\))?$"
    

    When I test it on

    2009 IA H.B. 184 (NS)

    it (still) finds the third word to be H.B.

    When I test it on

    2009 IA HEART RATE 184 (NS)

    it finds the third word to be HEART RATE

    When I test it on

    2009 IA HEART RATE None 184 (NS)

    it finds the third word to be HEART RATE None

    When I test it on

    2009 IA HEART RATE No. 184 (NS)

    it finds the third word to be HEART RATE

    Looks good?

    PS gskinner is awesome.

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

Sidebar

Related Questions

SQL 2008 I have a commission table that looks like this: Comm% | ProfitStartRange
Something like comm but for Windows (No, installing Cygwin just for this is not
I have parameters like this; comm.CommandText = usp_ProjectsCreateNew; SqlParameter param = comm.CreateParameter(); param.ParameterName =
DbParameter param = comm.CreateParameter(); param = comm.CreateParameter(); param.ParameterName = @StaffId; if (!string.IsNullOrEmpty(activity.StaffId)) param.Value =
Possible Duplicate: Where can I get to download Java comm api? I'm looking for
I need to bind a field(ComputerTag) to a Text field. This my code: public
I can't figure out how to pass total, sale and comm into Main(). Anybody
I am interested in working for a web-design company. Actually, this one: http://z-comm.com/ And
javax.comm.NoSuchPortException at javax.comm.CommPortIdentifier.getPortIdentifier sending sms(text) from java code to mobile phone in windows i
I tried to connect to SerialPort COM6 using (Windows XP) javax.comm library with this

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.