Sublime Forum

How to replace multiple characters in files using regex?

#1

Hello. I recently have the challenge to replace some special characters (Þ , þ , ª , º , ã , ) from a lot of files and replace them with other special characters: ( Ț , ț , Ș , ș , ă , ). The first ones are using the Western Windows 1252 encoding and the second ones are UTF-8.

I want to know if is possible to replace all this characters in one search using regex instead of searching and replacing five times.

Any help will be appreciated. Thank you.

0 Likes

#2

Researching, I made some progress. Now I can find all the desired characters in one search using formula:
(Þ)|(þ)|(ª)|(º)|(ã)

The only question that remains is how to replace them accordingly, in the following order:
Ț , ț , Ș , ș , ă

0 Likes