different optimized versions of solutions of the

version 1 solved with regular expression

version 2 solved with own implementation of algoritms