if those 8 lines of regex have been unit tested and the function is commented to describe "what" the code does, it is entirely the point that you don't need to understand how it works
additionally, the function should be stateless and have no side effects ;)