I'm having some trouble creating a regex that if it receives a string with an enum ( element, element, element, element_diferent, ... and element) then just leave the enum element other than hyjk11l
Example 1:
Input string:
"I come with hyjk11l, Mary Johnson, hyjk11l, hyjk11l, hyjk11l and hyjk11l to the center, maybe we'll buy something there"
the output that i need:
"I come with Mary Johnson to the center, maybe we'll buy something there"
Example 2:
Input string:
"In afternoon, I show hyjk11l, John, hyjk11l, and hyjk11l in the lab"
the output that i need:
"In afternoon, I show with John in the lab"
Example 3:
Input string:
"I meet with Katy Perry and hyjk11l here"
the output that i need:
"I meet with Katy Perry here"
I have tried using the replace() function, and some regex combinations but I don't get the desired result. I think maybe I could remove with replace() and all the ", hyjk11l", "hyjk11l", ", and hyjk11l" and/or "and hyjk11l", but I think that's complicated because I don't know how many times I have to do it (this seeks to be general, that is, you do not know what input string will be passed to you, for that the regex would be).