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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:25:11+00:00 2026-06-04T12:25:11+00:00

I have 1K strings like the following which are saved in a String array

  • 0

I have 1K strings like the following which are saved in a String array and I just need the bold words, which are not a constant)’. So wondering what could be the best way.

(descSummary: EME Commercial (Change Request), archived: false, name: EME Commercial (Change Request), uniqueName: EME Commercial (Change Request)(JTS-Sentinel-Id)) (isInitialized: true, internalPublic: true, internalVisibleToMembers: false, internalVisibleToAccessList: false, owningApplicationKey: JTS-Sentinel-Id, internalIsProcessProvider: false)

Please help!

  • 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-04T12:25:13+00:00Added an answer on June 4, 2026 at 12:25 pm

    Well, it looks like you are asking for the text after the string “name: ” and before the following comma, so your regex is /name: ([^,]+)/

    Update:

    I don’t understand why you’re using .replaceAll().

    You don’t need the slashes to delimit the regex when it’s in a Java string literal. Many people, like me, use the slashes to set it off in ordinary text.

    If you want to display the segment you have marked in bold, then you want something like this:

    Pattern pattern = Pattern.compile("name: ([^,]+)");
    Matcher matcher = pattern.matcher(str.toString());
    if (matcher.matches()) {
        System.out.println(matcher.group(0));
        System.out.println(matcher.group(1));
    }
    

    .group(0) returns the entire string that matched the pattern. .group(1) returns the string that matches the first “captured” group in parentheses, the ([^,]+) part.

    And why are you calling .toString() on str? The name of that variable suggests that it is a String already.

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

Sidebar

Related Questions

Suppose I have strings like the following : OneTwo ThreeFour AnotherString DVDPlayer CDPlayer I
I have a string like following: CREATE GLOBAL TEMPORARY TABLE some_temp_table_name or CREATE GLOBAL
I have a string like the following: $string = <paragraph>apples are red...</paragraph> <paragraph>john is
I have a string like the following: String str = 4*5; Now I have
I have a string like the following: <br><b>224h / 15.45 verbuchte Stunden</b> I want
Assume we have a string like the following : ,34,23,4,5,634,23,12,5,4,3,1234,23,54,,,,,,,123,43,2,3,4,5,3424,,,,,,,,123,,,1234,,,,,,,45,,,56 How can we convert
I have a string that is formatted like the following: ... {{word1}} {{word2}} ....
I have the following String First Last <first.last@email.com> I would like to extract first.last
Supposed I have the following string: string str = <tag>text</tag>; And I would like
Hi guys i have the following string &|L1|L2|L3|& I would like to extract L1

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.