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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:43:49+00:00 2026-06-11T18:43:49+00:00

I have this type of subtring string 1 { string 2 string 3 {

  • 0

I have this type of subtring

string 1
{
    string 2
    string 3
    {
        string 4
        string 5
    }
    string 6
    {
        string 7
        string 8
    }
    string 9
    {
        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15
    }
}
string 16
string 17

so basically i have java class type of structure
and now i want a piece of code which can get me following substrings(SS#)
SS1:

        string 4
        string 5

SS2:

        string 7
        string 8

SS3:

            string 13
            string 14

SS4:

string 16
string 17

SS5:

        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15

SS6:

    string 2
    string 3
    {
        string 4
        string 5
    }
    string 6
    {
        string 7
        string 8
    }
    string 9
    {
        string 10
        string 11
        string 12
        {
            string 13
            string 14
        }
        string 15
    }

so basically i want a piece of code that can get me various parts(function, classes, but not any loops) of string(java class) into different substrings…
i read this
Regex to get string between curly braces "{I want what's between the curly braces}"
but it only gets me data between a pair of ‘{‘, and ‘}’ without counting the ‘{‘ that have come after the first.
i don’t the full code, but some direction into how to proceed???

  • 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-11T18:43:51+00:00Added an answer on June 11, 2026 at 6:43 pm

    Though this is not perfectly done using RegEx, it’s always better to use a stack for that.

    But it only requires a RegEx solution then it might work (not always):

    (?is)\{[^}]*?\}(?=.*?\})
    

    Explanation

    <!--
    
        (?is)\{[^}]*?\}(?=.*?\})
    
        Match the remainder of the regex with the options: case insensitive (i); dot matches newline (s) «(?is)»
        Match the character “{” literally «\{»
        Match any character that is NOT a “}” «[^}]*?»
           Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
        Match the character “}” literally «\}»
        Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=.*?\})»
           Match any single character «.*?»
              Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
           Match the character “}” literally «\}»
        -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this type which is basically a struct { int x,y,z; } that
I have this anonymous type : var t= new {a=1,b=lalala,c=DateTime.Now}; How can I make
I have this IEnumerable of type Question.. the class Question has the properties, Question(string)
I have this type of structure <ul> <li>one</li> <li> two has children <ul> <li>a</li>
Lets say have this immutable record type: public class Record { public Record(int x,
I have this mysql table called comments which looks like this: commentID parentID type
Greetings All; I have a LinkedList of type String which contain some words like
I have a dict that has string-type keys whose exact values I can't know
I have this type of data: entity, account, month1, month2, ..., month12 abc, 2000.02,
I have this type of associative array. Array ( [0] => Array ( [bookedArea]

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.