Notepad++ regex replace

前端 未结 2 1450
悲&欢浪女
悲&欢浪女 2020-12-24 02:05

I have text file full of following lines:

F randomtext
F morerandomtext

what kind of regex I need so that the output would be like this:

相关标签:
2条回答
  • 2020-12-24 02:27

    Find:

    F (.*)
    

    Replace all with:

    \1,foo
    
    0 讨论(0)
  • 2020-12-24 02:48

    I'd like to add this: With Notepad++ you can find with regex and replace things in a set of files too. The following will find all files which has lines starting with capital F and space in D:\mydir -folder's *.txt files including subdirectories.

    To open Find in Files-window in Notepad++ type Ctrl+Shift+F.

    Find what: ^F (.*) 
    Replace with: \1,foo
    Filters: \1,foo
    Directory: D:\mydir
    Match case: Checked
    In all sub-folders: Checked
    Search Mode: Regular expression
    
    0 讨论(0)
提交回复
热议问题