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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:45:29+00:00 2026-05-31T17:45:29+00:00

I know the question sound’s a bit weird. Let me explain the situation: I

  • 0

I know the question sound’s a bit weird. Let me explain the situation:

I have an undefined text that looks like this:

Lorem {placeholder1} ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. {placeholder2} Cum sociis natoque penatibus et magnis dis parturient montes, {placeholder3} nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo

As you may notice, there are some placeholders inside the text: {PlaceholderX}. The only thing I know is that a placeholder is surrounded by {}. I dont know what’s between them.

Now i’m looking for the best way to get a list of all strings surrounded by {} out of my text.

Or, to make it more general, is there a method where I can provide some kind of pattern like {*} and get back all fitting words as strings?

  • 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-31T17:45:30+00:00Added an answer on May 31, 2026 at 5:45 pm

    You are looking for regular expressions, in this case you need to make use of lookarounds

    (?<=\{)(.*)(?=\})
    

    The .* means it will find any non-space character between the braces

    Here is a C# tutorial on how this can be used

    Here is an example that shows how to pull out each item

    I have adapted it for your example

    using System;
    using System.Text.RegularExpressions;
    
    class Program
    {
        static void Main()
        {
        // First we see the input string.
        string input = "Lorem {placeholder} ipsum {placeholder2} ...";
    
        // Here we call Regex.Match.
        Match match = Regex.Match(input, @"(?<=\{)(.*)(?=\})",
            RegexOptions.IgnoreCase);
    
        // Here we check the Match instance.
        if (match.Success)
        {
            // Finally, we get the Group value and display it.
            foreach(var matchgroup in match.Groups)
                Console.WriteLine(matchgroup.Value);
        }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that might sound like a stupid question since it's a trivial feature
I know it may sound like a weird question, but is there any .NET
I know this question might sound a little bit crazy, but I tough that
I know this might sound like a dumb question, but I have looked every
I know this may sound like a weird question to ask but I would
This might sound a bit of an odd question but I know what I
I know a question like this was already asked, but the situation is a
I know the question title isn't the best. Let me explain. I do a
I know this question will sound like a from the past thing but I
I know that my this question may sound pathetic to you but as a

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.