简体   繁体   English

如何在Notepad ++中使用正则表达式编辑Firefox书签

[英]How to edit Firefox bookmarks with regex in Notepad++

I need to combine multiple bookmarks files and reduce the size, but I don't know how to use regular expression. 我需要组合多个书签文件并减小其大小,但是我不知道如何使用正则表达式。

I want to: 我想要:

  1. Delete every line that starts with <DD> 删除以<DD>开头的每一行
  2. Delete the following HTML tags and the (unknown) text between the qoutes: ICON_URI="..." , ICON="..." , and LAST_CHARSET="..." 删除以下HTML标签和qoutes之间的(未知)文本: ICON_URI="..."ICON="..."LAST_CHARSET="..."
  3. Replace the text between > and </A> ></A>之间替换文本
  4. Delete duplicate lines 删除重复的行
  5. Sort lines alphabetically 按字母顺序对行进行排序

Tested in Notepad++, for other tools it may not work. 在Notepad ++中进行了测试,对于其他工具可能无法正常工作。 Also for some strange cases it could not work in Notepad++ as well 同样在某些奇怪的情况下,它也无法在Notepad ++中工作

 1. ^<DD>.*?$ - replace with empty string 2.ICON_URI="[^"]*" - replace with empty string 3.(<a[^>]+>).+?</a> - replace with \\1 </a> 4. This is hard to do with regex, you can use grouping and repetition, but I'm not advanced in that 5. Use excel or other similar tool and order there, much easier 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM