title: Regex to identify JSON in a String to split using : separator
body: <p>I have an input String which is being split using <code>:</code> (colon) as separator. This String can contain all string values OR possibly a json object itself as part of this incoming string.</p>
  <p>For example:</p>
  <p><em>Case#1:</em> <strong>123:HARRY_POTTER:ENGLAND:MALE</strong></p>
  <p><em>Case#2:</em> <strong>123:HARRY_POTTER:[{&quot;key&quot;:&quot;City&quot;, &quot;value&quot;:&quot;LONDON&quot;}]:MALE</strong></p>
  <p>There is code in place that uses <code>str.split(&quot;:&quot;)</code> which is handling the case#1, but for case#2 since the json part of the string contains <code>:</code> (which are to be ignored while splitting), the program breaks.</p>
  <p>I need a regex that could (1) identify the json in string and (2) a regex that would not split if <code>:</code> is preceded and followed by <code>&quot;</code> (<code>&quot;:&quot;</code>) as it appears in JSON string.</p>
  <p>So if the string is identifed to contain json i can use <code>str.split(&lt;regex-to-split-string-with-json&gt;)</code></p>
  <p><strong>I arrived at these regex to match for a <code>&quot;</code> preceding to <code>:</code> none of which are working unfortunately:</strong></p>
  <p>Negative Look Behind:  <code>(?&lt;!\&quot;):</code> and <code>(?&lt;!\&quot;)[:]</code></p>
  <p>Positive Look Behind: <code>(?&lt;=\&quot;):</code> and <code>(?&lt;=\&quot;)[:]</code></p>
  <p>Please suggest!</p>