score:1

Accepted answer

you can't do this with a single search-replace!

the only way is to use two search-replace:

  • the first with the punct-space

match: ^(\s*)(//)?(.*?)"([\p{punct}\p{space}]++)(\p{alnum}.*?\p{alnum})([\p{punct}\p{space}]*)?"(.*?)$

replace: $1$3"$4" \+ i18n.tr\("$5"\) \+ "$6"$7

  • second without the punct-space

match: ^(\s*)(//)?(.*?)"(\p{alnum}.*?\p{alnum})([\p{punct}\p{space}]*)?"(.*?)$

replace: $1$3i18n.tr\("$4"\) \+ "$5"$6

don't forget to do a backup before any tries


Related Query

More Query from same tag