I want to transform some Russian tags to latin characters and changing codepage does not work correctly (it gives rubbish). So I want to do it manually with regexes. I want the action to be sensitive for that if the tag is uppercase or if only first letters of words are capitalised. The problem is that sometimes you get two (or three) latin letters for one cyrylic letter.
I want the script to use uppercase latin letters if the whole word is uppercase and to capitalise only first letter if the original word has only the first letter capitalised. (e.g. [on lattin letters - suppose I want to replace every P with Po]: PLACE -> POLACE, but Place -> Polace).
I don't want to change capitalisation of original tags (cause there are names and other things that should not be lowercased) so replacing letters normally and using Capitalise or Uppercace action does'nt satisfy me.
I tried such regex:
Regular expression: ([A-Z])?P([A-Z])?
Replace with: $if($or($1,$2),$1PO$2,$1Po$2)
I wonder why it doesn't work and how to achive my goal.
BTW it is a mystery to me how to use the $if function? Does it works correctly only on tags fields and not on backrefferences ($1,$2)?
Thanks a lot if anyone can help me!