How to replace whitespace with notepad++ between two characters

前端 未结 2 1114
执笔经年
执笔经年 2021-02-15 11:00

I have question how to replace whitespace with _ using notepad++ regex between [] characters

Example :

sl.[Posting date]                       AS TIME, 
         


        
相关标签:
2条回答
  • 2021-02-15 11:32

    Find what: [.+(\s)+.+]

    Replace with: _

    Also don't forget to select Regular expression radio button in Search mode section.

    Update:

    Ok, I have one solution but it's dirty:

    You need to perform several replacements to do that.

    Find what: (\[.*)\s(.*\])

    Replace with: \1_\2

    Repeat using Replace all until there will be no occurrences.

    0 讨论(0)
  • 2021-02-15 11:46

    Use

    Regex Replace

    (\[[^ ]*) +(.*\])
    

    with

    $1_$2
    

    if you want to replace multiple space character with a single _ OR

    Regex Replace

    (\[[^ ]*) (.*\])
    

    with

    $1_$2
    

    if you want to replace each space character with a single _

    0 讨论(0)
提交回复
热议问题