in reply to matching substrings on each line

Crossposted at StackOverflow. It is considered polite to inform about crossposting so people not attending both sites do not waste their time on problems already solved at the other end of the internets.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ