Editing
Regular expression in Mandarin
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== 方案1: Sublime Text, EmEditor ==== 語法適用 [http://www.sublimetext.com/ Sublime Text], [http://www.emeditor.com/ EmEditor]軟體 (以下為 EmEditor 的操作說明) # Menu: Search -> Replace # click "Use Regular Expression" ## Find: {{kbd | key = <nowiki>\n</nowiki>}} ([[Return symbol | 換行符號]] 。{{Win}} 作業系統的換行符號是 {{kbd | key = <nowiki>\r\n</nowiki>}}、{{Mac}} 作業系統的換行符號是 {{kbd | key = <nowiki>\n</nowiki>}},取兩者共有的符號。如果使用 {{Linux}} 作業系統的換行符號是 {{kbd | key = <nowiki>\r</nowiki>}}。 ) ## Replace with: {{kbd | key = <nowiki>, </nowiki>}} # click "Replace all" <div style="float: left; width: 100%; position: relative; display: block; clear: left;"> <div style="width: 46%; float: left; margin:0 auto; position: relative; display: block; "> ===== 將每行的文字,移除換行,並且都加上逗號分隔 ===== <pre> // before Elmo Emie Granny Bird // after Elmo, Emie, Granny Bird </pre> 方法: 使用 [http://www.sublimetext.com/ Sublime Text] 或 [https://zh-tw.emeditor.com/ EmEditor]。 * Find what: {{kbd | key = <nowiki>\n</nowiki>}} * Replace with: {{kbd | key = <nowiki>, </nowiki>}} 此例是將每行的文字,都加上逗號+空格分隔 (如果要用別的符號分隔,例如頓號分隔,則是 Replace with: {{kbd | key = <nowiki>、</nowiki>}}) </div> <div style="width: 46%; float: left; margin:0 auto; position: absolute; display: block; left: 54%; top: 0;"> ===== 將逗號分隔的文字,還原成逐行顯示,並且移除分隔符號 (,) ===== <pre> // before Elmo, Emie, Granny Bird // after Elmo Emie Granny Bird </pre> 方法: 使用 [http://www.sublimetext.com/ Sublime Text] 或 [https://zh-tw.emeditor.com/ EmEditor]。{{exclaim}} 輸出結果的每行前面可能會有空白 * Find what: {{kbd | key = <nowiki>([^,]+),</nowiki>}} * Replace with: {{kbd | key = <nowiki>\1\n</nowiki>}} </div> </div> <div style="clear:both;"> </div>
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information