is there regex works for col ?

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


       [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


    [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

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

  • @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?

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

    Code Alignment plugin

    yes but this is implantation using .net Framework 4.5

  • @gurikbal-singh

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

  • @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.

  • @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:

    Changing it slightly to conform to the new site:

    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?

  • Hi, @gurikbal-singh and All,

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

    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,


Log in to reply