Eg: sdadjaskdhas ^{sdassad ^{/frac{}{} s dcds &} dsdsadsa} ddsfsafdsfs
Answer should be: {sdassad ^{/frac{}{} s dcds &} dsdsadsa}
it should include any character between brackets
Eg: sdadjaskdhas ^{sdassad ^{/frac{}{} s dcds &} dsdsadsa} ddsfsafdsfs
Answer should be: {sdassad ^{/frac{}{} s dcds &} dsdsadsa}
it should include any character between brackets
Use backspace to escape the ^,{,}
characters as they belong to regex. .*
to select any number of any characters.
Here is your answer: \^\{.*\}
EDIT: You can use this regex [^\^]\^{(\S)} , print the match, trim the string. Loop over this you find all matches in a string.