Find differences between two strings with regex
<p>I have been provided with two example input strings:</p>

<p>"Russia has entered the WWII in [A] [B] after german invasion"</p>

<p>"Russia has entered the WWII in September 1941 after german invasion"</p>

<p>There can be any characters before, after and between the [A] and [B] in the first string and there could be additional placeholders e.g. [C] [D] etc. Each placeholder can only occur once. </p>

<p>How can I use regex to match "September" and "1941"? </p>

<p>I need to match each placeholder in a single regex, not multiple steps.  </p>

<p><strong>My thoughts at a solution</strong></p>

<p>I'm guessing the solution will be something like:</p>

<p>'Match everything in string 2 after everything before [A] in string 1 and before everything after [A] in string 1'. </p>

<p>I figured out <code>(.*(:?\[A\]))</code> and <code>((:?\[A\]).*)</code> to get the text before and after the [A] in the first string, but can't figure out how to use that to look at the second string. Perhaps I need to concatenate the two things with some sort of delimiter and look at either side of the delimiter? </p>