我有一个文本文件,里面充满了以下内容的行:
我需要什么样的正则表达式才能得到这样的输出结果:
所以F变成了foo并移到了行尾。
F randomtext
F morerandomtext
我需要什么样的正则表达式才能得到这样的输出结果:
randomtext,foo
morerandomtext,foo
所以F变成了foo并移到了行尾。
查找:
F (.*)
将所有内容替换为:
\1,foo
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
Replace with: \1,foo
Explanation of regex:
^\S+ ##Match from starting 1 or more occurrences of non-spaces here.
\s ##Matching space here.
(.*)$ ##Creating one and only Capturing group which contains everything till the end of the value.