Hello @marcelo1983
You can find some insights in the following post:
If your data-set is large and looking for performance, you might prefer a regex based solution.
Your thoughts about are welcome.
BR
P.S. This would be your starting preprocessing of codes. Quantify combinations would be the next step. A mock dataset would be great to draft a touchable workflow.