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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:15:56+00:00 2026-06-12T15:15:56+00:00

I want to extract the values surrounded by brackets. text = The man who

  • 0

I want to extract the values surrounded by brackets.

text = “The man who {said} and also {var2} as well as {var3}

openingParen = InStr(text, "{")
closingParen = InStr(text, "}")
enclosedValue = Mid(text, openingParen + 1, closingParen - openingParen - 1)

phrasevariable1.Value = enclosedValue
phrasevariable2.Value = enclosedValue
phrasevariable3.Value = enclosedValue

This code only works for extracting the first value, is there a way to extract each of the variables, and put them into the textbox 1 -> n accordingly

  • 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-12T15:15:57+00:00Added an answer on June 12, 2026 at 3:15 pm

    You can use a regular expression for an unknown number of candidate tokens;

    Dim matches As Object
    Dim Re As Object: Set Re = CreateObject("vbscript.regexp")
    Dim count As Long
    
    Re.Pattern = "{(.*?)}"
    Re.Global = True
    Set matches = Re.Execute("The man who {said} and also {var2} as well as {var3}")
    
    count = matches.count
    For i = 0 To count - 1
        MsgBox matches(i).submatches(0)
    Next
    

    (Add a ref to Microsoft VBScript Regular Expressions for early binding)

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

Sidebar

Related Questions

I want to extract attribute1 and attribute3 values only. I don't understand why charset
I want to parse the input string and extract the values from it. My
I want to extract hours, minutes and seconds as integer values from a time_t
I want to extract the file name 13572_BranchInformationReport_2012-06-28.zip from the following text - 1:30,/icons/def13572_BranchInformationReport_2012-06-28.zip,13572_BranchInformationReport_2012-06-28.zip,0,184296,Jun
i am new to XMl. i want to extract the status values in the
I want to extract values from built in boxplot function. In A1 there are
i want to extract number string values of a char array. Actually I want
I want to extract the values - Screen Name, Name, ID, Profile Picture URL
I want to extract Microdata values. I use a Yii App runned from the
I want to extract following values from the url mentioned below? layout2 aqua code:

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.