// Define the string
const str: string = 'This is a string with "double-quoted substring1", and "double-quoted substring2" inside.';
// Regular expression pattern to match substrings within double quotes
const pattern: RegExp = /"([^"]*)"/g;
// Find all matches with proper type annotations
const matches: string[] = [...str.matchAll(pattern)].map(match => match[1]);
console.log(matches);
/*
run:
[ 'double-quoted substring1', 'double-quoted substring2' ]
*/