Aleyküm Selam,

Regex kullanarak bu işlemi halledebilirsin.

Örneğin;

https://www.regextester.com/27540

Saygılarımla,