Community
    • Login

    Is There A Way To Ignore Letters With Accents When Searching?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 5 Posters 154 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Troglo37T Offline
      Troglo37
      last edited by

      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.

      CoisesC 1 Reply Last reply Reply Quote 0
      • CoisesC Offline
        Coises @Troglo37
        last edited by

        @Troglo37 said:

        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.)

        Troglo37T 1 Reply Last reply Reply Quote 1
        • Troglo37T Offline
          Troglo37 @Coises
          last edited by

          @Coises How and where do I put that?

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • guy038G Offline
            guy038
            last edited by guy038

            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.xml file, 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.xml file should be within the folder %AppData%\Notepad++

            • If you installed N++ with a portable package, your active shortcuts.xml file should be along with the Notepad++.exe file, in your install folder

            • You may also define a shortcut for this Global Search macro, by opening the Settings > Shortcut Mapper... > Macros tab and double-clicking on the Global Search line !

            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 Search macro

            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 around option

            • Select the Regular expression search mode

            • Click on the Find Next or Find All in Current Document button

            => 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
            
            dr ramaanandD 1 Reply Last reply Reply Quote 0
            • PeterJonesP Online
              PeterJones @Troglo37
              last edited by

              @Troglo37 said:

              @Coises How and where do I put that?

              Find/Replace dialog, Find What. And set Search Mode = Regular Expression

              dr ramaanandD 1 Reply Last reply Reply Quote 2
              • dr ramaanandD Offline
                dr ramaanand @PeterJones
                last edited by dr ramaanand

                He has to hit Ctrl+F on the keyboard or use the drop-down from the Menu bar on top to open that dialogue

                1 Reply Last reply Reply Quote 0
                • dr ramaanandD Offline
                  dr ramaanand @guy038
                  last edited by

                  @guy038 said:

                  [[=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.

                  dr ramaanandD 1 Reply Last reply Reply Quote 0
                  • dr ramaanandD Offline
                    dr ramaanand @dr ramaanand
                    last edited by dr ramaanand

                    @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

                    1 Reply Last reply Reply Quote 0

                    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
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors