 <p>This is a good example to use negative lookbehind, you can use this regex to get the content you want:</p> <pre><code>”.*?(?&lt;!\\)” </code></pre> <p><strong><a href="http://regex101.com/r/fB6dP2/1" rel="nofollow noreferrer">Working demo</a></strong></p> <p>Using capturing groups you can grab those strings:</p> <pre><code>(”.*?(?&lt;!\\)”) </code></pre> <p><img src="https://i.stack.imgur.com/K44gi.png" alt="enter image description here"></p> <p>Here is the matches</p> <pre><code>MATCH 1 1. [4-41] `”aaaa\”bbbbb\”ccccccc\”ddddd\”eeeeee”` MATCH 2 1. [46-80] `”ffffff\”ggggg\”hhhh\”iiiii\”jjjj”` </code></pre> <p>Then you can apply the logic you want on this strings.</p>