How to keep selected set of strings and remove all the other set of strings from main string using Regex.Replace?

I want to remove MEA1B4, WP and HIC from MEA1B4, SLI, CPR, WP, HIC using Regex.Replace and print as SLI, CPR.

I have tried to do the above functionality using the pattern of .(SLI\S?CPR).* , Yet I only managed to replace the main string as SLI and couldn’t get full string as SLI, CPR

36 thoughts on “How to keep selected set of strings and remove all the other set of strings from main string using Regex.Replace?”

  1. Pingback: krystal sex games

Leave a Comment