Community
    • Login

    moving year in a date from the end to the front.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    27 Posts 7 Posters 2.3k 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.
    • Paul WormerP
      Paul Wormer @PeterJones
      last edited by

      @PeterJones Good catch! I started to suspect something like that. Would we have seen it if he had cut and pasted his input into a code block?

      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP
        PeterJones @Paul Wormer
        last edited by PeterJones

        @Paul-Wormer ,

        Would we have seen it if he had cut and pasted his input into a code block?

        Nope, the forum turns NBSP into a normal space, even in a code block. (I tried before posting my reply). Code boxes are better, but they don’t give 100% of what’s being pasted. (This forum software was designed for generic use, and isn’t specialized in being able to post things that tend more toward the “binary” nature rather than “normal text”)

        For @Vegard-Johansen and others who don’t know, the “code boxes” are generated by:

        1. Paste your text in the forum
        2. select that text
        3. Click the </> button on the forum’s post-editing toolbar :

        This would take your text, and the edit panel would have shown

        ```
        "120000" "various" "646958" "20220323" "12" "firstname lastname" "-4 497" "20220407" "646958"
        ```
        

        and it would render as

        "120000" "various" "646958" "20220323" "12" "firstname lastname" "-4 497" "20220407" "646958"
        

        That would have been better than what you posted, because it at least showed the real quote marks rather than the “smart quotes” that we see in your post. But unfortunately, a special character like the NBSP doesn’t come through even then.

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

          Hello, @Vegard-Johansen, @gerdb42, @alan-kilborn, @wonkawilly, @paul-wormer, @peterjones and All,

          Good intuition, @peterjones, indeed !

          I suppose that the Non Breaking Space characters are intentionally used between parts of a number. So, when the text of this document is wrapped, any number will be moved entirely to the next line and not separated in two parts ( one part at the end of a line and the remaining of the number on the next line )

          BR

          guy038

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

            Maybe answers in the future should use [\x20\xA0] to match spaces. :-(
            Or maybe \h is often appropriate (but it isn’t as exacting).

            Paul WormerP 1 Reply Last reply Reply Quote 2
            • Vegard JohansenV
              Vegard Johansen @PeterJones
              last edited by

              @PeterJones @guy038 @Alan-Kilborn @gerdb42 And everyone else :)

              Thank so much, this community is so nice. it worked with this one: (?<=\d)\xA0+(?=\d) in the document. hopefully it will work tonight when the system import file. i will let you know 100% tomorrow :) Again thank you so much for all help!

              1 Reply Last reply Reply Quote 0
              • Paul WormerP
                Paul Wormer @Alan Kilborn
                last edited by

                @Alan-Kilborn Why not use \s? It matches all 17 Unicode space characters and also tabs, new line and new paragraph characters.

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

                  @Paul-Wormer said in moving year in a date from the end to the front.:

                  Why not use \s

                  For the same reason that I hesitatingly recommended \h … because it opens up the match to more than what is wanted, a dangerous thing to do with regex.

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