Upper case letter in replace
Hakunamatata67 last edited by Hakunamatata67
I have many documents to translate. So I opened them in NP++ and replace many words at one time with ‘Replace in all opened documents’.
For example: I want to translate “dog” to “chien” (in french). If it’s “Dog”, I want it replace to “Chien”.
If I check “Preserve case”, it only replaces the first one, not the one with with the first letter in capital (Dog).
Is there any way to replace the words in both situation without having to retype the same twice (one in lower case and one with first letter in capital)?
Ekopalypse last edited by
use regular expression search mode and check match case (I guess that what you translated to preserve case).
guy038 last edited by
Hello, @Hakunamatata67, @ekopalypse and All,
An other syntax could be :
(?-i)(?:(D)|d)ogor more simply
Thank you guys :)
I have an issue: if I replace “he” to “il” (in french), it will also replace all word containing “he”, for example, it will replace “other” to “otilr”.
Any way to avoid that?
guy038 last edited by guy038
Hi, @Hakunamatata67, @ekopalypse and All,
Ah yes, I should have been more specific ! So, my regexes become :
And, if you prefer the @ekopalypse’s syntax :
\bis an assertion which represents a zero-length location between, both :
A non-word character and a word character
A word character and a non-word character
(?#Test)structure, in replacement, rewrites the word Test if the group
#has been matched in search regex
You’re the best guy038!
Thank you so much