Excel - Extract string between two strings
With Office 365, you can do:
=LET( line, D3,
sentences, MID( line, FIND( "[", line ), 99999),
sarr, FILTERXML( "<m><s>" & SUBSTITUTE( sentences, "{", "</s><s>" ) & "</s></m>", "//s" ),
larr, INDEX( sarr, FILTER( SEQUENCE( ROWS( sarr ) ), ISNUMBER( FIND( "'selected': True", sarr ) ) ) ),
s, FIND( "'label': '", larr)+10, f, FIND( "',", larr, s ),
MID( larr, s, f-s ) )
Where D3 is your target cell with your original line.
I suspect there is an easier way with a better FILTERXML hack, but it does not come to me at the moment. If JvdV is on line, he would know. Also, P.b. would probably do this in a better way.
NB: you must be consistent with string definitions. You must use ' as opposed to ".
Another approach is to force the conversions of " to '. This will do that, but it may have unintended consequences:
=LET( line, D3,
sentences, MID( SUBSTITUTE( line,"""","'"), FIND( "[", line ), 99999),
sarr, FILTERXML( "<m><s>" & SUBSTITUTE( sentences, "{", "</s><s>" ) & "</s></m>", "//s" ),
larr, INDEX( sarr, FILTER( SEQUENCE( ROWS( sarr ) ), ISNUMBER( FIND( "'selected': True", sarr ) ) ) ),
s, FIND( "'label': '", larr)+10, f, FIND( "',", larr, s ),
MID( larr, s, f-s ) )