Changed the custom delimiter function, now it uses regex