Community
    • Login

    Show printable ASCII characters only

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    12 Posts 6 Posters 1.0k Views
    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.
    • Neil SchipperN
      Neil Schipper @KalleMP
      last edited by

      @KalleMP said in Show printable ASCII characters only:

      hide non-printable characters

      An approach that might get you close to what you want is to use a regex to match every char that is not something you want to see, and replace it with empty:

      Fi: [^A-Z0-9a-z\\\^\]\r\n`~!@#$%^&*()-_+=[{}|;:'",<.>/?]
      Re: (empty)

      I ran it on a .chm and .dll and it seems to work.

      It’s a bit slow with large files.

      Since it’s changing and not just hiding you have to take care to not save.

      1 Reply Last reply Reply Quote 2
      • guy038G
        guy038
        last edited by

        Hello @kallemp, @ekopalypse, @neil-schipper and All,

        Neil, regarding the regex method, here are two other solutions where I suppose, by extension, that the Tabulation and the Space characters are considered as printable chars !

        • SEARCH (?s)(?![\x{0020}-\x{007E}\t\r\n]).

        • REPLACE \xA0

        OR

        • SEARCH (?-i)[^]!"#$%&'()*+,.0-9/:;<=>?@A-Z[\\^_\x60a-z{|}~\x20\t\r\n-]

        • REPLACE \xA0


        Notes :

        • I replace any non-printable character with a No-Break-Space char which does not displays any gliph, even if you click on the ¶ button !

        • Unfortunately, these replacements, instead of your suppresion method, is about 3 times slower :-((

        Best Regards,

        guy038

        Neil SchipperN 1 Reply Last reply Reply Quote 2
        • Neil SchipperN
          Neil Schipper @guy038
          last edited by

          Hi @guy038

          the Tabulation and the Space characters

          Including tab did actually flit thru my mind as I was prepping the expression… but then flew away. I totally forgot about space.

          As for subbing in a space for the non-printables, I can see both how someone might prefer to preserve the positions of printable text, as well as preferring to delete them to make the text more compact, so it’s good that @kallemp has the option.

          As for the benefit of No-Break-Space vs conventional space, that under Show all Chars it resolves ambiguity between a space from the original text and a non-printable that got hidden, that’s interesting, thanks. (If there’s more to it than that, I’m not seeing it.)

          But then for completeness, it should also be stated that if the original text happens to have a lot of A0, then ambiguity may actually be increased.

          Also for completeness, it should be stated that if there is a desire to see some of the extended characters (Euro language chars w/accents, different currency symbols, etc) any of the above 3 expressions would need to be tweaked accordingly.

          Best,
          Neil

          Alan KilbornA 1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Neil Schipper
            last edited by Alan Kilborn

            I keep getting notifications about new posts (specifically just got one on this thread), but when I go to them, I don’t see new content. What gives?

            I certainly hope that someone with moderator powers isn’t “changing the past”; if they are I certainly request that they STOP DOING THAT, and spend their efforts on more worthy tasks.

            Neil SchipperN 1 Reply Last reply Reply Quote 0
            • Neil SchipperN
              Neil Schipper @Alan Kilborn
              last edited by

              @Alan-Kilborn

              I just got an email notification that this Mar/22 contribution of Guy’s mentions me, but the comment is neither new nor newly edited.

              1 Reply Last reply Reply Quote 1
              • Alan KilbornA
                Alan Kilborn
                last edited by

                (Sorry to continue the off-topicness of recent posts in this thread)

                Now I see:

                b7ca0dc2-21ce-4661-99fc-a38353b1da95-image.png

                with no visible “LATE DATE EDIT:” annnotations visible anywhere in these older posts.

                It seems @guy038 is for some reason editing old posts, with no way for anyone to know what is changing. Guy I’d politely request that you cease this behavior; otherwise I’d request of other moderators here to petition for removing Guy’s moderator powers.

                Neil SchipperN 1 Reply Last reply Reply Quote -1
                • Neil SchipperN
                  Neil Schipper @Alan Kilborn
                  last edited by

                  @Alan-Kilborn said in Show printable ASCII characters only:

                  It seems @guy038 is for some reason editing old posts

                  I think you are not properly understanding the conspiracy:

                  c58ca51a-24fc-4523-8801-a173bb7bada7-image.png

                  It’s not that Guy is editing his posts.

                  It’s that someone is working hard to call my attention to threads in which my contribution was effing lame.

                  Alan KilbornA 1 Reply Last reply Reply Quote 0
                  • Alan KilbornA
                    Alan Kilborn @Neil Schipper
                    last edited by

                    @Neil-Schipper said in Show printable ASCII characters only:

                    It’s not that Guy is editing his posts.
                    It’s that someone is working hard to call my attention to threads in which my contribution was effing lame.

                    I think you are being humorous with some self-deprecating comments?
                    Guy IS editing old posts.

                    Terry RT 1 Reply Last reply Reply Quote 0
                    • Terry RT
                      Terry R @Alan Kilborn
                      last edited by Terry R

                      @Alan-Kilborn said in Show printable ASCII characters only:

                      Guy IS editing old posts.

                      I had queried him a few days ago. When he replied it was to say that @PeterJones had also queried it. Apparently his edits are benign, of course we have to take his word on that.

                      It is a bit disconcerting that someone edits posts so long ago. Of course it’s also a bit disconcerting about the recent change in ability of normal users to edit posts for a longer period of time as well. It means someone can answer with a solution only to find the specifics of the request have changed in the intervening period.

                      Terry

                      Alan KilbornA 1 Reply Last reply Reply Quote 1
                      • Alan KilbornA
                        Alan Kilborn @Terry R
                        last edited by

                        @Terry-R said in Show printable ASCII characters only:

                        Apparently his edits are benign

                        Even “benign” edits are annoying because I get a notification that there is something “new” to read. And even if such edits are “harmless”, they should be documented (like Peter will do) with an “EDIT: …” at the bottom explaining what was done.

                        If an edit is so harmless that typing an “EDIT: …” explanation at the bottom would be silly…WHY even make that edit in the first place? Leave old postings the way they are (find better things to do with your time).

                        It means someone can answer with a solution only to find the specifics of the request have changed in the intervening period.

                        I agree and have made these feelings known, but no further changes came from that.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors