Regular expression: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
== 將Email清單,轉成Email軟體可以使用的寄信名單 (取代換行符號) ==
== case ==
=== 將Email清單,轉成Email軟體可以使用的寄信名單 (取代換行符號) ===
<pre>
<pre>
原  
原  
Line 10: Line 11:
</pre>
</pre>


=== 方案1: EmEditor ===
==== 方案1: EmEditor ====
使用[http://www.emeditor.com/ EmEditor]軟體
使用[http://www.emeditor.com/ EmEditor]軟體
# Menu: Search -> Replace
# Menu: Search -> Replace
Line 18: Line 19:
# click "Replace all"
# click "Replace all"


=== 方案2: Notepad++ ===
==== 方案2: Notepad++ ====
使用[http://notepad-plus-plus.org/ Notepad++]軟體
使用[http://notepad-plus-plus.org/ Notepad++]軟體
# 選單: 尋找 -> 取代
# 選單: 尋找 -> 取代
Line 28: Line 29:
相關資料: [http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Replacing_Newlines How To Replace Line Ends, thus changing the line layout] last visited: 2010-01-27
相關資料: [http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Replacing_Newlines How To Replace Line Ends, thus changing the line layout] last visited: 2010-01-27


=== 方案3: Microsoft Word ===
==== 方案3: Microsoft Word ====
使用Microsoft Word 2002軟體
使用Microsoft Word 2002軟體
# 選單: 編輯 -> 取代
# 選單: 編輯 -> 取代
Line 37: Line 38:




== Find IP address ==
=== Find IP address ===
使用[http://notepad-plus-plus.org/ Notepad++]軟體 v.5.9.5
使用[http://notepad-plus-plus.org/ Notepad++]軟體 v.5.9.5
# 選單: 尋找 -> 取代
# 選單: 尋找 -> 取代
Line 46: Line 47:


參考資料: [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]
== syntax ==
==== Notepad++ ====
* 換行符號: \r\n
* tab: \t


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

Revision as of 17:08, 2 January 2012

case

將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. 勾選全部取代


Find IP address

使用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

syntax

Notepad++

  • 換行符號: \r\n
  • tab: \t

further reading