HELP sort a column based on data in another column

In the Above worksheet I have two columns, Column A Data has a matching row that contains the text in Column B
eg. 2017_PS_DE_Epay_gCard_WEWCY_VD_BAR.eps from Column A and WEWCY from Column B

I am looking to re sort Column A into a new column so the rows match the corresponding Data in Column B

Paste in C1: =VLOOKUP("*"&SUBSTITUTE(MID(B1;FIND(" ";B1);99);"x.x";"")&"*";A:A;1;0)

Drag C1 down into all occupied rows, then choose menu Data - Text to columns…, unmarck checkboxes, OK.
Check results for possible errors.

Formula adapted from @mariosv at ask.libreoffice.org/es/. An ad hoc answer is welcome, then I delete mine; I’ll upvote.