Search code examples
replacenotepad++

Notepad++ dynamic "replace with"


I want to replace found result (with regular expression) by a dynamic space count.

This will be found by: (XY\w.*_\d\d )(\w.*)

XY_bbb_11 PT
XY_brtztsd_34 KJH
XY_bghg_44 LOP

Expected result:

XY_bbb_11       PT
XY_brtztsd_34   KJH
XY_bghg_44      LOP

Is it possible in Notepad++?


Solution

  • This can be done using Elastic TabStops plugin.

    1. Run plugin Manager and install Elastic Tabstops
    2. Go to Plugins > Elastic Tabstops and tick Enable
    3. tick Convert spaces to Elastic Tabs

    Screenshot (before):

    enter image description here

    Screenshot (after):

    enter image description here