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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:48:30+00:00 2026-06-05T21:48:30+00:00

I need to get information on variables and the only thing I have is

  • 0

I need to get information on variables and the only thing I have is the variable name. In this case let’s say I need to get the chunk that belongs to SOME_LARGE_VARIABLE (every chunck starts with <0> and ends with <0>)

In other words how can I get the chunk <0>....SOME_LARGE_VARIABLE.....<0>

Note I do not want to have <0> ...... <0> ..... SOME_LARGE_VARIABLE .... <0>

<0>
    temp
<0>
    fo0
<0>
    BLA BLA BLA
    kjfsd
    foodskjdsf
    kj
<0>
    someVariable
<0>
    SOME_LARGE_VARIABLE
<0>

So far I have tried:

<0>[\s\S]*?SOME_LARGE_VARIABLE[\s\S]*?<0>

that finds <0> and then continues until it finds SOME_LARGE_VARIABLE and stops until <0>

note that will select everything

my temporary solution is:

<0>[\s\S]{1,25}SOME_LARGE_VARIABLE[\s\S]*?<0>

this restricts the selection to less than 25 characters. I think this is to risky because there might be two chuncks smaller than 25 characters


EDIT

In other words I want to end up with:

<0>
   SOME_LARGE_VARIABLE
<0>

and the only thing I have is SOME_LARGE_VARIABLE knowing that every chunk starts and ends with <0>

  • 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-05T21:48:32+00:00Added an answer on June 5, 2026 at 9:48 pm

    Instead of using .*? you could use (?:(?!<0>).)*, like so:

    <0>(?:(?!<0>).)*SOME_LARGE_VARIABLE(?:(?!<0>).)*<0>
    

    But you might as well be better off splitting the string on <0> and checking which parts match SOME_LARGE_VARIABLE.


    Note that the expression will never match the second “chunk” in:

    <0> SOME_LARGE_VARIABLE   will match
    <0> SOME_LARGE_VARIABLE   will not match
    <0>
    

    Because the second <0> is consumed by the expression, not allowing it to match. (The splitting approach does not have this problem.)

    You can fix that by using a lookahead tho:

    <0>(?:(?!<0>).)*SOME_LARGE_VARIABLE(?:(?!<0>).)*(?=<0>)
    

    If you want . to match line breaks as well, add (?s) in the beginning of the expression, like so:

    (?s)<0>(?:(?!<0>).)*SOME_LARGE_VARIABLE(?:(?!<0>).)*(?=<0>)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JInternalFrame and I need to get some Information from user (a
I am developing a Facebook Application that I need to get all the information
I need to be able to get all of this information (as text) into
I need to get information on loaded data percentage when UIWebView loads page. I
I need to get information about applied CSS styles in HTML page. I used
I need to get information about the scrollbars (position, size, visibility) of a Webbrowser
I desperately need to be able to get some information from the request array
so I have multiple HTML files which I need to get some praticular data
I have a legacy table of user information (that is still in active use)
I want to make a class that will have a single get template method

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.