• Login
Community
  • Login

is there regex works for col ?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
9 Posts 5 Posters 596 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.
  • R
    rinku singh
    last edited by Sep 19, 2019, 10:57 AM

    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
    
    E 1 Reply Last reply Sep 19, 2019, 11:13 AM Reply Quote 0
    • M
      Michael Vincent
      last edited by Sep 19, 2019, 11:00 AM

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

      R 1 Reply Last reply Sep 19, 2019, 11:42 AM Reply Quote 2
      • E
        Ekopalypse @rinku singh
        last edited by Sep 19, 2019, 11:13 AM

        @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
        • R
          rinku singh @Michael Vincent
          last edited by Sep 19, 2019, 11:42 AM

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

          Code Alignment plugin

          yes but this is implantation using .net Framework 4.5

          A M 2 Replies Last reply Sep 19, 2019, 12:13 PM Reply Quote 0
          • A
            Alan Kilborn @rinku singh
            last edited by Sep 19, 2019, 12:13 PM

            @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
            • M
              Michael Vincent @rinku singh
              last edited by Sep 19, 2019, 12:26 PM

              @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
              • A
                Alan Kilborn
                last edited by Sep 19, 2019, 12:30 PM

                @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
                • R
                  rinku singh
                  last edited by Sep 20, 2019, 6:50 PM

                  Merge files in one plugin review

                  submitted pull request

                  1 Reply Last reply Reply Quote 1
                  • G
                    guy038
                    last edited by guy038 Oct 19, 2019, 8:32 PM Oct 19, 2019, 8:31 PM

                    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