An example,
I have a string that contains let’s say:
function main {
// TODO print ‘hello {cmd get
world} world {nice}!’s asdadshello ‘l{o}l’.’asd’
}
How can I select only the words that are in within ”’s and that are not inside a {}’s. This example would return the output:
match 1:
‘hello {
} world {
}!’
match 2:
‘l{
}l’
match 3:
‘asd’
thanks a lot!
If you just wanted all six matching strings separately I would use
['}].*?['{]but you seem to want three strings in which case I would first replace}[^']*?{with}{and then match on'.*?'.