Is There A Way To Ignore Letters With 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 -
-
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