I want to find strings between curly brackets and store the string into a variable.

sample string:
{This is a
First
curly
bracket}
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
sample string:
{This is a
First
curly
bracket}
kevin007 wrote: I want to find strings between curly brackets and store the string into a variable.
{This is a
First
curly
bracket}
Code: Select all
matchText( aString, "(?s){(.+?)}", theMatch )
Just tried out and it works as expected herekevin007 wrote:@Thierry
It's only works when the string is in same line, if the part of the string is in another line it is not working
{{This is a}
First {\alpha}
curly {[$\beta$]}
bracket}
Mmm, better stop using regex except if you are ready to learn them...kevin007 wrote: In the following case How to change the code.![]()
Code: Select all
offset(charsToFind, stringToSearch [, charsToSkip])