Hello,
I am Python Engineer, I've already create many Python scripts for String manipulation, I've seen the documents attached with this offer, I am familiar with such problems due to my experience in competitive programming.
Feel free to contact me for details.
Best Regards.