Extract a string from a given string
CJam, 34 33 32 bytes

'"l_l2%&amp;2*2&gt;NerN/0"null"t_,3=='"


Try it online in the CJam interpreter.

Idea


Remove the second character from line 2.
Form a string consisting of a single copy of all characters that both lines have in common.
Repeat the resulting string twice and discard its first two characters.

This results in a two-character string (if the characters from line 2 are different and both occur in line 1) or an empty string.
Replace the characters of the resulting string in line 1 by linefeeds.
Split line 1 at linefeeds.

The resulting array's second element will be the desired string if the array contains exactly three chunks.
Replace the first element of the array with the string null.
Retrieve the second element of the array if its length is 3 and the first otherwise.
Prepend and append a double quote.


Code

'"       e# Push a double quote.
l_       e# Read one line from STDIN. Push a copy.
l2%      e# Read one line from STDIN. Only keep characters at odd indexes.
&amp;        e# Intersect both strings.
2*2&gt;     e# Repeat the intersection twice and discard the first two characters.
Ner      e# Replace the characters of the resulting string with linefeeds.
N/       e# Split the result at linefeeds.
0"null"t e# Replace the first element of the resulting array with "null".
_,3=     e# Push 1 if the length of the array is 3 and 0 otherwise.
=        e# Retrieve the corresponding element from the array.
'"       e# Push a double quote.