Much better regex manipulation