Using RegEX To Prefix And Append In Notepad++

后端 未结 4 1486
醉酒成梦
醉酒成梦 2020-11-30 16:56

I have quite a large list of words in a txt file and I\'m trying to do a regex find and replace in Notepad++. I need to add a string before each line and after each line.. S

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 17:42

    Assuming alphanumeric words, you can use:

    Search  = ^([A-Za-z0-9]+)$
    Replace = able:"\1"
    

    Or, if you just want to highlight the lines and use "Replace All" & "In Selection" (with the same replace):

    Search = ^(.+)$
    

    ^ points to the start of the line.
    $ points to the end of the line.

    \1 will be the source match within the parentheses.

提交回复
热议问题