Code golf edit distance 2
Retina 0.8.2, 76 58 bytes

^(.*)(.*¶)\1
$2
(.*)(¶.*)\1$
$2
^.?¶.?$

^.?(.*).?¶.?\1.?$


Try it online! Takes the two strings on separate lines, but link includes test suite which takes space-separated strings instead, so that I can easily use the test cases. Explanation:

^(.*)(.*¶)\1
$2


Delete the common prefix.

(.*)(¶.*)\1$
$2


Delete the common suffix.

^.?¶.?$


Ignore an edit distance of less than two.

^.?(.*).?¶.?\1.?$


Check that only the first and last characters have been edited, so that the edit distance cannot be greater than two in this case.

From a code golf point of view this can be done in 51 bytes but then the regex becomes unbearably slow to execute for longer strings:

^(?!(.*).?(.*)¶\1.?\2$)(.*).?(.*).?(.*)¶\3.?\4.?\5$


Try it online! Takes the two strings on separate lines, but link includes test suite which takes space-separated strings instead, so that I can easily use the test cases. Explanation:

^


Match the whole input.

(?!(.*).?(.*)¶\1.?\2$)


Don't match strings with an edit distance less than two.

(.*).?(.*).?(.*)¶\3.?\4.?\5$


Match strings with an edit distance less than three.