Difficulties with adding spaces around equal signs using regular expressions with Notepad++

前端 未结 4 1601
花落未央
花落未央 2021-01-14 18:22

I am currently trying to improve the readability of some of my python scripts by adding spaces around the equal signs. For example, currently an assignment looks like this:

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-14 19:19

    With your initial regex,

    Regex:

    (?<=[\w\]\)])=(?=\w)
    

    REplacement string:

     =
    

    I added instead of . Lookarounds would do a zero width match. It won't match any characters.

    DEMO

提交回复
热议问题