How to remove or replace familiar words in string, by list of familiar stubs of that words?
List contain ~40 stubs (substrings). With all of this I expect substitute hundreds matching words.
I'm interested in formula solution because I already know how to do this, coding VBA.
I play around TEXTJOIN with FILTERXML, but its not possible to use it for big stub list:
Formula 1. FILTERXML (one by one entered stub)
=IFERROR(TEXTJOIN(" ";;FILTERXML("<A><B>"&SUBSTITUTE(A2;" ";"</B><B>")&"</B></A>";"//B[not(contains(., 'auti') or contains(., 'AuTi') or contains(., 'tion') or contains(., 'mpl') or contains(., 'Mpl')or contains(., 'etc'))]"));"")
Result is good, but unfortunately is case sensitive, so one by one entered substrings for all capitalization version (Propercase, UPERCASE, lowercase, MixEdCase) generate a very big formula impossible to use because of length limitation (255 characters).
Formula 2. FILTERXML (with case translation)
=IFERROR(TEXTJOIN(" ";;FILTERXML("<T><S>"&SUBSTITUTE(A2;" ";"</S><S>")&"</S></T>";"//S[not(contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'auti')or contains(., 'tion')or contains(., 'mpl')or contains(., 'etc'))]"));"")
Result is good apparently, but there is some strange missed capitalization matches (check cell D14 in attached image). To avoid this, I can use translation for each stub translate(., 'AUTI', 'auti'),'auti')
but length limitation will not leave me to use all list.
Formula 3. FILTERXML (with LOWER-ing all string)
=IFERROR(TEXTJOIN(" ";;FILTERXML("<A><B>"&SUBSTITUTE(LOWER(A2);" ";"</B><B>")&"</B></A>";"//B[not(contains(., 'auti')or contains(., 'tion') or contains(., 'mpl') or contains(., 'etc'))]"));"")
Result is good, but output string is totally lower. And again length limitation is still there.
I know FILTERXML is a good way for this task, but I don't know how to work with. Unfortunately Xpath 1.0 doesn't allow things like matches()