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

前端 未结 4 1592
花落未央
花落未央 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:08

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

    You can use this . Replacement by

     " \1 "
    

    See Demo.

    http://regex101.com/r/vY0rD6/2

    Your earlier regex had no captured pattern.So just added that.

提交回复
热议问题