Problem with converting lowercase to uppercase
I see good RegEx specialists here,
maybe I can solve the problem here.
I want to replace:
Mckenzie, Mccoy, mcdonalds
McKenzie, McCoy, McDonalds
I’m using a different editor, and RegEx doesn’t use \u or \l there
and it comes out like this:
Mcenzie, Mcoy, Mconalds
Can you do it without this “\u”?
PeterJones last edited by
guy038 last edited by guy038
Hello, @pan-jan and All,
Try this regex S/R :
which changes any form, as below :
mcDonalds McDonalds mCDonalds MCDonalds mcdonalds Mcdonalds mCdonalds MCdonalds
with the unique good syntax :
(?i)in-line modifier carries the search in an insensitive way
[[:alpha:]]POSIX class range represents any single
In replacement, the
\usyntax rewrites the next letter, stored in group
Hello @pan-jan and All,
I’m really sorry but the regex syntax
\u, in replacement, does do the job ! That is to say it capitalizes the first letter of the following string or group !
For instance :
changes the word foo, with this exact case, by Bar
would change the words
bar, with this exact case, by the words
Ekopalypse last edited by Ekopalypse
Ah… OK. So, what’s he waiting for to switch to Notepad++ ;-)))
If so, why don’t you join the
Akelpadcommunity and find out a solution, from within this software, or, may be, ask the
Akelpad’s author to improve the regex engine ?
Thomas 2020 last edited by Thomas 2020
I asked before.
No response means nothing can be done.
I see there are some good RegEx specialists here
and I’m trying to solve the problem here.
mkupper last edited by mkupper
Implementation of regex varies from one application to the next.
It’s a guess based on the OP’s results but it seems that \u in the OP’s editor is the lead-in for Unicode related stuff such as
\u0025for a percent (%) sign. The OP’s examples have \xFFFF characters in them.
Fiddling with people’s names seems dangerous as there are people who have Mc… style surnames where the third character is not upper-case. If there is a requirement to make the names a consistent case then convert everything to upper case.
I think we are in https://community.notepad-plus-plus.org/topic/15958/faq-desk-you-ve-asked-your-question-in-the-wrong-place territory.