Corrected regexp. Used re:replace/4 option instead of multiple IOlists functions.