Not the most elegant solution, as I did not use the RegEx tool, but still functional. The RegEx proposed in the solution makes things look much more refined and elegant. Also developing such solution would be much faster than when using multiple other tools.