Skip to content

Instantly share code, notes, and snippets.

@lhsfcboy
Last active November 6, 2017 04:36
Show Gist options
  • Save lhsfcboy/c04e31c1695b1c97441171151e80e586 to your computer and use it in GitHub Desktop.
Save lhsfcboy/c04e31c1695b1c97441171151e80e586 to your computer and use it in GitHub Desktop.
notepad_plus_plus中的正则表达式
Target:
1、第1章 第1节 集合(1)2、第1章 第1节 集合(2)3、第1章 第1节 集合
Purpose:
Search for "1、" and replace with newline plus that
Solution:
Search: (\d{1,3}\、)
Replace: \n\1
-----------------------------------------------------------------------
Target:
第14章 第2节 第二类曲线积分与第二类曲面积分
第14章 第2节 第二类曲线积分与第二类曲面积分
第14章 第3节 Green公式, Gauss公式和Stokes公式
第14章 第3节 Green公式, Gauss公式和Stokes公式
Purpose:
Remove continuous duplicated lines
Solution:
Search: ^(.*\r?\n)(\1)+
Replace: \1
Solution:
(Need to check ". matches newline":)
      Search: ^(.*?)$\s+?^(?=.*^\1$)
Replace: (Replace with nothing)
--------------------------------------------------
Target:
9
12:56
Learning to Answer Yes/No :: Non-Separable Data @ Machine Learning Foundations (機器學習基石)
10
17:27
Types of Learning :: Learning with Different Output Space @ Machine Learning Foundations (機器學習基石)
Purpose:
      Search for "9","10","12:56","17:27" and remove that line
Solution:
      Search: ^\d{1,2}$(\r\n)?
^\d{1,2}:\d{2}$(\r\n)?
Replace:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment