Regular expression: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
(add http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Regular_Expressions)
Line 38: Line 38:


== IP ==
== IP ==
使用[http://notepad-plus-plus.org/ Notepad++]軟體
使用[http://notepad-plus-plus.org/ Notepad++]軟體 v.5.9.5
# 選單: 尋找 -> 取代
# 選單: 尋找 -> 取代
# 搜尋模式: 勾選「用類型表式」
# 搜尋模式: 勾選「用類型表式」
## 尋找目標: \d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?
## 尋找目標: \d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?
note: not support {n} syntax


參考資料: [http://sourceforge.net/projects/notepad-plus/forums/forum/331754/topic/4780602 SourceForge.net: Notepad++: Regular expression for IP addresses]
參考資料: [http://sourceforge.net/projects/notepad-plus/forums/forum/331754/topic/4780602 SourceForge.net: Notepad++: Regular expression for IP addresses]


== further reading ==
== further reading ==

Revision as of 15:16, 4 November 2011

將Email清單,轉成Email軟體可以使用的寄信名單 (取代換行符號)

[email protected]
[email protected]
[email protected]

改成
[email protected], [email protected], [email protected]

方案1: EmEditor

使用EmEditor軟體

  1. Menu: Search -> Replace
  2. click "Use Regular Expression"
    1. Find: \n
    2. Replace with: ,
  3. click "Replace all"

方案2: Notepad++

使用Notepad++軟體

  1. 選單: 尋找 -> 取代
  2. 搜尋模式: 勾選「增強模式」 (不是勾選「用類型表式」)
    1. 尋找目標: \r\n
    2. 取代成: ,
  3. 勾選全部取代

相關資料: How To Replace Line Ends, thus changing the line layout last visited: 2010-01-27

方案3: Microsoft Word

使用Microsoft Word 2002軟體

  1. 選單: 編輯 -> 取代
  2. 勾選增強模式
    1. 尋找目標: ^p (段落標記)
    2. 取代為: ,
  3. 勾選全部取代


IP

使用Notepad++軟體 v.5.9.5

  1. 選單: 尋找 -> 取代
  2. 搜尋模式: 勾選「用類型表式」
    1. 尋找目標: \d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?

note: not support {n} syntax

參考資料: SourceForge.net: Notepad++: Regular expression for IP addresses

further reading