Community
    • Login

    is there regex works for col ?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 5 Posters 577 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.
    • rinku singhR
      rinku singh
      last edited by

      hi this is a sample, i want regex for my plugin

      before

         [Console output]    WWWWWWWWWWW     [Console output]
      form_X=781    WWWWWWWWWWW     form_X=781
      form_Y=183    WWWWWWWWWWW     form_Y=183
      pluginname=0    WWWWWWWWWWW     pluginname=0
      form_Height=258    WWWWWWWWWWW     form_Height=258
      form_Width=470    WWWWWWWWWWW     form_Width=470
      splitContainer=90    WWWWWWWWWWW     splitContainer=90
      checkBox1=0    WWWWWWWWWWW     checkBox1=0
      checkBox2=0    WWWWWWWWWWW     checkBox2=0
      

      after

      [Console output]      [Console output]
      form_X=781            form_X=781
      form_Y=183            form_Y=183
      pluginname=0          pluginname=0
      form_Height=258       form_Height=258
      form_Width=470        form_Width=470
      splitContainer=90     splitContainer=90
      checkBox1=0           checkBox1=0
      checkBox2=0           checkBox2=0
      
      EkopalypseE 1 Reply Last reply Reply Quote 0
      • Michael VincentM
        Michael Vincent
        last edited by

        Looks like maybe you want the Code Alignment plugin - available in the Plugin Admin for both 32 and 64-bit Notepad++.

        rinku singhR 1 Reply Last reply Reply Quote 2
        • EkopalypseE
          Ekopalypse @rinku singh
          last edited by

          @gurikbal-singh

          if you want to have this from within your plugin wouldn’t it make sense to
          parse the output from within your plugin and do the needed formatting?
          Most language do have such thing as printf implemented.
          Isn’t this an option for you?

          1 Reply Last reply Reply Quote 2
          • rinku singhR
            rinku singh @Michael Vincent
            last edited by

            @Michael-Vincent said in is there regex works for col ?:

            Code Alignment plugin

            yes but this is implantation using .net Framework 4.5

            Alan KilbornA Michael VincentM 2 Replies Last reply Reply Quote 0
            • Alan KilbornA
              Alan Kilborn @rinku singh
              last edited by

              @gurikbal-singh

              Certainly nothing in .NET Framework 4.5 stops you from doing this sort of formatting with it!

              1 Reply Last reply Reply Quote 1
              • Michael VincentM
                Michael Vincent @rinku singh
                last edited by

                @gurikbal-singh

                Sorry, misread the question. You’re doing this in the code for your plugin it seems, then the Code Alignment plugin code itself may help as a guidance; seems it’s in C#. Otherwise, agree with @Ekopalypse about printf or whatever the “.net Framework 4.5” equivalent is.

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

                  @Ekopalypse

                  This is off-topic, but not really!: Before the site migration, I made a text copy of a link to a posting you made where you asked a question of Pythonscript users. Here’s the original link text which of course doesn’t work now: https://notepad-plus-plus.org/community/topic/18268/question-for-pythonscript-users/

                  Changing it slightly to conform to the new site:

                  https://community.notepad-plus-plus.org/topic/18268/question-for-pythonscript-users/

                  doesn’t work either to get to the original posting (it actually brings me to THIS topic which has the same topic number 18268! That’s why this is “not really” off topic…it is exactly on-topic!

                  However, at a similar time frame I copied 7 other old site links and changing all of those to the new format results in them working! (Why did I do this? Well, at the time I had free time to read postings, but not in-depth or make replies, so I basically copied their link text into a text file for later use)

                  So I wonder what happened with your Pythonscript question post…and maybe some others that got lost with the migration??

                  ANYWAY…I had interest in replying to your Pythonscript posting (about multiple NOTIFICATIONS I think it was), so could you create a new topic and post it again so that I can?

                  1 Reply Last reply Reply Quote 2
                  • rinku singhR
                    rinku singh
                    last edited by

                    Merge files in one plugin review

                    submitted pull request

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

                      Hi, @gurikbal-singh and All,

                      I was away from the N++ community since more than a month ( see my post below )

                      https://community.notepad-plus-plus.org/post/47895

                      So, my reply is probably out of date and may be obsolete !


                      To strictly answer your question, if you want that the second column starts at column N, use the generic regex S/R :

                      SEARCH (?-s)^.{N-2}\K\x20+

                      REPLACE Leave Empty

                      and click, exclusively on the Replace All button

                      Thus, if you need that the second column starts, let’s say, at column 21, use the following S/R :

                      SEARCH (?-s)^.{19}\K\x20+

                      REPLACE Leave Empty


                      Of course, the number N must be in the interval [a,b], where :

                      • a = Maximum length of column 1 + 1

                      • b = Minimum column starting column 2 - 1

                      So, in our example : a = 17 + 1 = 18 and b = 31 - 1 = 30 => N must be in interval [18-30]

                      Best Regards,

                      guy038

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