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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:03:48+00:00 2026-05-20T23:03:48+00:00

I have a long string that contains text. I want to extract every word

  • 0

I have a long string that contains text. I want to extract every word in between parentheses (' '), but only as long as there is no more than one word in between the parentheses (IE, no spaces).

For example, in the below:

<ul>
<li>7-SPEED DOUBLE CLUTCH AUTOMATIC TRANSMISSION (2TC)</li>
<li>MOONLIGHT BLACK SOFT TOP (3YA)</li>
<li>8-WAY PWR FRONT BUCKET SEATS -inc: driver memory, 2-way adjustable headrests, exterior mirror memory (459)</li>
<li>BLACK SAPPHIRE METALLIC (475)</li>
<li>HEATED FRONT SEATS (494)</li>
<li>GLACIER SILVER ALUMINUM TRIM (REQ: ZMP M Sport Pkg) (4MG)</li>
<li>NAVIGATION SYSTEM -inc: hard drive, HD Radio, real-time traffic info, voice command, cupholders (609)</li>
<li> ASSIST W/BLUETOOTH -inc: (4) year subscription (w/609 Navigation System-inc: Online info services) (639)</li>
<li>IPOD & USB ADAPTER (6FL)</li>
<li>M SPORT STEERING WHEEL-MOUNTED SHIFT PADDLES (REQ: ZSP Sport Pkg or ZMP M Sport Pkg & 205 Auto Trans) (7XA)</li>
<li>BLACK, BOSTON LEATHER SEAT TRIM (LWSW)</li>
<li>M SPORT PKG -inc: 18&quot; x 7.5&quot; front & 18&quot; x 8.5&quot; rear double-spoke light alloy wheels (style 261M), P215/40R18 front & 245/35R18 rear performance tires, 8-way manual front sport seats, M sport steering wheel, shadowline exterior trim, increased top speed limiter (w/205 Auto Trans REQ: 7XA Shift Paddles) (ZMP)</li>
<li>PREMIUM PKG -inc: Boston leather seat trim, universal garage door opener, auto-dimming pwr folding exterior mirrors w/memory, auto-dimming rearview mirror w/digital compass, pwr front seats w/pwr lumbar support,  Assist w/(4) year subscription, Bluetooth, illuminated exterior door handles, front/rear reading lights, front footwell illumination, driver/front passenger illuminated vanity mirrors, ambiance interior lighting (ZPP)</li>
<li>VALUE PKG -inc: Boston leather seat trim, iPod and USB adapter (ZVP)</li>
</ul>

I want to get as a result

2TC 3YA 459 475 494 4MG 609 639 6FL 7XA LWSW ZMP ZPP ZVP

What is the best way to parse this? I’m implementing this in C# if it matters

  • 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-20T23:03:49+00:00Added an answer on May 20, 2026 at 11:03 pm

    The regex \((\S+)\) should do the trick.

    string pattern = @"\((\S+)\)";
    MatchCollection matches = Regex.Matches(str, pattern);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a unit test with variable that contains a very long string. Question
I want to create a dialog that contains some kind of text element (JLabel/JTextArea
I have some text which occasionally contains very long strings of characters, which is
I have a fixed width div on my page that contains text. When I
I have an array list that contains Quote objects. I want to be able
Lets say textfile contains the following: lorem$ipsum-is9simply the.dummy text%of-printing and that you want to
Suppose you have a dictionary that contains valid words. Given an input string with
I have a long string (a DNA sequence). It does not contain any whitespace
i have a long running function¹: public string FindPasswordFromHash(String hash) { ... } which
I have a long sequence of hex digits in a string, such as 000000000000484240FA063DE5D0B744ADBED63A81FAEA390000C8428640A43D5005BD44

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.