Is there a way to find both alphabets, with and without accents, when searching?
-
Another issue I’ve been dealing with is letters with accents. Many times I’ve searched for a name and couldn’t find it. Later on, I realized that it was because the name had an accent. So, I’ve had to painstakingly go through some of the names I have typed in and change the letters.
I want to be able to copy and paste names without worrying about accents, and preferably have the correct spelling of the person’s name if they have accents.
-
Another issue I’ve been dealing with is letters with accents. Many times I’ve searched for a name and couldn’t find it. Later on, I realized that it was because the name had an accent. So, I’ve had to painstakingly go through some of the names I have typed in and change the letters.
I want to be able to copy and paste names without worrying about accents, and preferably have the correct spelling of the person’s name if they have accents.
It has been requested before. At present there is a way, but not a convenient way.
To search for a name like
Renéyou can use the following form as a regular expression:
[[=r=]][[=e=]][[=n=]][[=e=]]Yes, it’s a pain in the butt. Maybe someday someone will make a simple switch for it. (Note to self: my still-in-progress Search++ plugin should have that as an option for plain text searches.)
-
@Coises How and where do I put that?
-
Hello, @troglo37, @coises and All,
@troglo37, you said :
@Coises How and where do I put that?
Well, I’ll give you a general method which :
-
Firstly, change any stream selection, in a regex build with equivalence class expressions
-
Secondly, find any text which satisfy the complete list of these equivalent classes
- First, we are going to add the macro, described below, within your active
shortcut.xmlfile, right before the line containing</Macros>
<Macro name="Global Search" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(\w)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="(?1[[=$0=]]:$0)" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>Reminder :
-
If you installed N++ with an installer package, your active
shortcuts.xmlfile should be within the folder%AppData%\Notepad++ -
If you installed N++ with a portable package, your active
shortcuts.xmlfile should be along with theNotepad++.exefile, in your install folder -
You may also define a shortcut for this
Global Searchmacro, by opening theSettings > Shortcut Mapper... > Macrostab and double-clicking on theGlobal Searchline !
Now :
-
Close and restart Notepad++
-
Paste the French text, below, in a new tab ( I rewrote the same French text in different cases ! )
C'est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l'aïeul ôta sa flûte et son bâton de son canoë C'EST LÀ, PRÈS DE LA FORÊT, DANS UN GÎTE, OÙ RÉGNAIT UN GRAND CAPHARNAÜM, QUE L'AÏEUL ÔTA SA FLÛTE ET SON BÂTON DE SON CANOË C'est Là, Près De La Forêt, Dans Un Gîte, Où Régnait Un Grand Capharnaüm, Que L'aïeul Ôta Sa Flûte Et Son Bâton De Son Canoë C'Est Là, près DE LA FORêT, dAns Un gÎte, OÙ rÉgNaIT Un GRaND cAPHaRnaÜM, QUE L'aïEul ôta sa flÛtE et sON bÂTon de soN caNoË-
Switch to that new tab
-
Select all the contents of the very first line
-
Run the
Macro > Global Searchmacro
You should get, at once, this selected OUTPUT
[[=C=]]'[[=e=]][[=s=]][[=t=]] [[=l=]][[=à=]], [[=p=]][[=r=]][[=è=]][[=s=]] [[=d=]][[=e=]] [[=l=]][[=a=]] [[=f=]][[=o=]][[=r=]][[=ê=]][[=t=]], [[=d=]][[=a=]][[=n=]][[=s=]] [[=u=]][[=n=]] [[=g=]][[=î=]][[=t=]][[=e=]], [[=o=]][[=ù=]] [[=r=]][[=é=]][[=g=]][[=n=]][[=a=]][[=i=]][[=t=]] [[=u=]][[=n=]] [[=g=]][[=r=]][[=a=]][[=n=]][[=d=]] [[=c=]][[=a=]][[=p=]][[=h=]][[=a=]][[=r=]][[=n=]][[=a=]][[=ü=]][[=m=]], [[=q=]][[=u=]][[=e=]] [[=l=]]'[[=a=]][[=ï=]][[=e=]][[=u=]][[=l=]] [[=ô=]][[=t=]][[=a=]] [[=s=]][[=a=]] [[=f=]][[=l=]][[=û=]][[=t=]][[=e=]] [[=e=]][[=t=]] [[=s=]][[=o=]][[=n=]] [[=b=]][[=â=]][[=t=]][[=o=]][[=n=]] [[=d=]][[=e=]] [[=s=]][[=o=]][[=n=]] [[=c=]][[=a=]][[=n=]][[=o=]][[=ë=]]- Immediately, open the Find dialog (
Ctrl + F)
=> The selected text has populated the search field
-
Make sure that none of the checkboxes are checked
-
Just check the
Wrap aroundoption -
Select the
Regular expressionsearch mode -
Click on the
Find NextorFind All in Current Documentbutton
=> It should matches, successively, the four lines of the new bab
I supppse that’s your expected result !
Best Regards,
guy038
FYI, My test sentence—which has no real meaning but displays all the accented French characters—can be translated into American - English as :
It was there, near the forest, in a cabin that was in a state of utter chaos, that the grandfather took his flute and his walking stick out of his canoe -
-
-
He has to hit Ctrl+F on the keyboard or use the drop-down from the Menu bar on top to open that dialogue
-
[[=C=]]‘[[=e=]][[=s=]][[=t=]] [[=l=]][[=à=]], [[=p=]][[=r=]][[=è=]][[=s=]] [[=d=]][[=e=]] [[=l=]][[=a=]] [[=f=]][[=o=]][[=r=]][[=ê=]][[=t=]], [[=d=]][[=a=]][[=n=]][[=s=]] [[=u=]][[=n=]] [[=g=]][[=î=]][[=t=]][[=e=]], [[=o=]][[=ù=]] [[=r=]][[=é=]][[=g=]][[=n=]][[=a=]][[=i=]][[=t=]] [[=u=]][[=n=]] [[=g=]][[=r=]][[=a=]][[=n=]][[=d=]] [[=c=]][[=a=]][[=p=]][[=h=]][[=a=]][[=r=]][[=n=]][[=a=]][[=ü=]][[=m=]], [[=q=]][[=u=]][[=e=]] [[=l=]]’[[=a=]][[=ï=]][[=e=]][[=u=]][[=l=]] [[=ô=]][[=t=]][[=a=]] [[=s=]][[=a=]] [[=f=]][[=l=]][[=û=]][[=t=]][[=e=]] [[=e=]][[=t=]] [[=s=]][[=o=]][[=n=]] [[=b=]][[=â=]][[=t=]][[=o=]][[=n=]] [[=d=]][[=e=]] [[=s=]][[=o=]][[=n=]] [[=c=]][[=a=]][[=n=]][[=o=]][[=ë=]]
That has accented alphabets but it should have unaccented alphabets to find all alphabets, including unaccented alphabets.
-
@guy038 @peterjones Please change the title of this thread from, “Is There A Way To Ignore Letters With Accents When Searching?” to, “Is there a way to find both alphabets with and without accents when searching?” - right now, it gives the opposite meaning of the solution sought. An explanation for this type of solution can be found at https://community.notepad-plus-plus.org/topic/27449/search-accented-and-non-accented-characters-alike-with-one-simple-setting
-
Hello, @troglo37, @coises, @peterjones, @dr-ramaanand and All,
Préamble :
@troglo37, on demand of @dr-ramaanand, I changed your initial title :
Is There A Way To Ignore Letters With Accents When Searching?by this new title, which seems more acurrate :
Is there a way to find both alphabets, with and without accents, when searching?
Thank you, @dr-ramaanand, for reminding me of this interesting post, which uses a more general, but more accurate, definition of accented characters !
Indeed, an accented character , let’s say the
écharacter, may be described as :-
The character
éLATIN SMALL LETTER E WITH ACUTE, of Unicode value00E9 -
The character
eLATIN SMALL LETTER E, of Unicode value0065, followed with the characteŕCOMBINING ACUTE ACCENT, of Unicode value0301
Note that, in this second form, the letter
eis the main character of an\Xsequence and the accent(s), coming next, are the subsequent chars of this\Xsequence !
So, the macro, described in my previous post, should be changed as :
<Macro name="Global Search" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?=\X)(.)|(?!\X)." /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="(?1\(\?=[[=$1=]]\)\\X)" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>And it means that :
-
If the current character found is a single character OR the main character of a current
\Xsequence, it must be replaced with the string(?=[[=$1=]])\X, where$1represents the current char -
If the current character found is an subsequent character of the current
\Xsequence, thus an accent, it must just be deleted as its main character has been previously taken in account
So, let’s consider the following text, pasted in a new tab :
C'est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l'aïeul ôta sa flûte et son bâton de son canoë C'est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l'aïeul ôta sa flûte et son bâton de son canoëNote that, within the first line, the accented characters are single chars whereas, within the second line, the accentued chars are unaccented vowels followed with an accent character
If we apply our modified
Global Searchmacro against the first line of this new tab, we get this regex :(?=[[=C=]])\X(?=[[='=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=à=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=p=]])\X(?=[[=r=]])\X(?=[[=è=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=o=]])\X(?=[[=r=]])\X(?=[[=ê=]])\X(?=[[=t=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=î=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=ù=]])\X(?=[[= =]])\X(?=[[=r=]])\X(?=[[=é=]])\X(?=[[=g=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=r=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=p=]])\X(?=[[=h=]])\X(?=[[=a=]])\X(?=[[=r=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=ü=]])\X(?=[[=m=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=q=]])\X(?=[[=u=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[='=]])\X(?=[[=a=]])\X(?=[[=ï=]])\X(?=[[=e=]])\X(?=[[=u=]])\X(?=[[=l=]])\X(?=[[= =]])\X(?=[[=ô=]])\X(?=[[=t=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=l=]])\X(?=[[=û=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=b=]])\X(?=[[=â=]])\X(?=[[=t=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=o=]])\X(?=[[=ë=]])\XWhich does match the two lines of the new tab !
And if we apply our
Global Searchmacro against the second line of this new tab, we get this regex :(?=[[=C=]])\X(?=[[='=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=p=]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=o=]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=ù=]])\X(?=[[= =]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=g=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=r=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=p=]])\X(?=[[=h=]])\X(?=[[=a=]])\X(?=[[=r=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=u=]])\X(?=[[=m=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=q=]])\X(?=[[=u=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[='=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=e=]])\X(?=[[=u=]])\X(?=[[=l=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=t=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=l=]])\X(?=[[=u=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=b=]])\X(?=[[=a=]])\X(?=[[=t=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=o=]])\X(?=[[=e=]])\XWhich does match, also, the two lines of the new tab !
In conclusion, this method allows you to search for a stream selection of characters, regardless of the syntax of the accented characters within that selection !
Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login