Regex 哪个文本编辑器支持将找到的结果提取到另一个文件中?

Regex 哪个文本编辑器支持将找到的结果提取到另一个文件中?,regex,extraction,textedit,Regex,Extraction,Textedit,通常我有以下情况: 有一个具有属性列表的PONO类 public string UserName { get { return this.userName; } set { if (this.userName != value) { SetDirty(); this.userName = value; } } } public string Password { get { return this.pass

通常我有以下情况: 有一个具有属性列表的PONO类

    public string UserName
    {
        get { return this.userName; }
        set { if (this.userName != value) { SetDirty(); this.userName = value; } }
    }

    public string Password
    {
        get { return this.password; }
        set { if (this.password != value) { SetDirty(); this.password = value; } }
    }

    public string Email
    {
        get { return this.email; }
        set { if (this.email != value) { SetDirty(); this.email = value; } }
    }

    public string Title
    {
        get { return this.title; }
        set { if (this.title != value) { SetDirty(); this.title = value; } }
    }
是否有工具,最好是记事本++或VS插件,将正则表达式输出提取到另一个文件中

例如:查找:“公共字符串(.*)”结果:


在新文件中。

在记事本++中使用
搜索
/
查找
对话框,并在
标记
选项卡中选中
书签行
复选框-在
标记所有
之后,所有需要的行上都会有书签。

最后一步是
搜索
/
书签
/
复制书签行
并将其粘贴到新文件中,您可以从中删除
公共字符串
部分

从v5.8.7变更日志:

  • 为了减少混淆,在查找/替换对话框中为“全部标记”功能创建了新的“标记”选项卡

我猜
书签行
复选框和
标记所有
都放在v5.8.6的另一个选项卡中。

不是文本编辑器解决方案,而是

grep“public string.+$”out


应该有用。未测试。

我在“查找”对话框中没有“标记”选项卡。带有默认插件的记事本++v5.8.6。在记事本++v5.8.6中,查找选项卡上有一个复选框用于此功能,但我建议更新记事本。您也可以在记事本++中删除“公共字符串”部分。标记全部后,执行搜索/添加书签/删除未标记行。然后返回“查找/替换”对话框。单击“替换”选项卡,并(在使用显示的原始搜索字符串时)将\1放入替换字符串中。然后按全部替换。
UserName
Password
Email
Title