Convert to a bit more robust solution,

Final regex isn't printing correctly, not sure why