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
You can use a regular expression for an unknown number of candidate tokens;
(Add a ref to Microsoft VBScript Regular Expressions for early binding)