Hi,
Ca you share specific input samples and expected outputs? In this case, regex | might help you.
Regards,