I flagged this answer as a comment to a previous answer (this one, but it was disputed and I don’t understand why. I do believe that it’s a comment to the respective answer and I do believe that it should be treated as such.
Here is the part from the previous answer, this one is referring to:
I believe the solution becomes a little more straight forward (and reasonably efficient, I would say):
=IFERROR(REGEXREPLACE(A2;JOIN("|";Lookup!$A$2:$A$5);VLOOKUP(REGEXEXTRACT(A2;JOIN("|";Lookup!$A$2:$A$5));Lookup!$A$2:$B$5;2;0)&"");A2)