Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as PHP by MOONRAKER ( 14 years ago )
<?php
  // $regex0 = '/(?<=>)[^<]+(?=<\/|$)/';
  $regex0 = '/(?<=^|>)[^<]+(?=<\/|$)/';
  $ansi_open = "((";
  $ansi_close = "))";
  $plaintext0 = <<<EOT
  '''日月潭'''([[邵語]]:'''Zintun'''),簡稱'''明潭''',位於[[台灣]][[南投縣]][[魚池鄉_(台灣)|魚池鄉]][[日月村]],為台灣第二大[[湖泊]](僅次於[[曾文水庫]])及第一大(半)天然湖泊兼發電[[水庫]]。湖面海拔748公尺,常態面積7.93平方公里(滿水位8.4平方公里),最大水深27公尺,自然生態豐富,但亦為最多外來種生物的[[淡水湖|淡水湖泊]]之一。 日月潭景色優美,「雙潭秋月」為[[台灣八景]]之一<ref name="勝蹟篇">《重修臺灣省通志》,卷二土地志勝蹟篇,第九頁</ref>。日月潭也是[[台灣原住民]][[邵族]]的居住地。由於過去[[平埔族]]稱居住於山裡的原住民為「沙連」,而內山以日月潭一區為最大的[[日月潭盆地|積水盆地]],故日月潭舊稱又為'''[[水沙連]]'''。 [[2000年]]1月,[[交通部觀光局]]設立[[日月潭國家風景區]],其範圍除原有日月潭特定區外,北面擴大至[[魚池鄉 (台灣)|魚池鄉]],東至[[水社大山]],西至[[集集大山]],南至[[水里蛇窯]]<ref name="multiple">台灣的國家風景區 陳永森;林孟龍/著 ISBN 9867630211 2004年2月出版</ref>。 ==
EOT;
  $replaced0 = preg_replace($regex0, "{$ansi_open}$0{$ansi_close}", $plaintext0);
  $replaced1 = preg_replace($regex0, '(())', $plaintext0);
?>
<html>
<head>
</head>
<body>
  <style type="text/css">
    div {
      margin: 5mm;
    }
  </style>
  <div>
    <b>plaintext</b>
    <?echo htmlspecialchars($plaintext0); ?>
  </div>
  <div>
    <b>highlighted</b>
    <?echo htmlspecialchars($replaced0); ?>
  </div>
  <div>
    <b>removed</b>
    <?echo htmlspecialchars($replaced1); ?>
  </div>
</body>
</html>

 

Revise this Paste

Your Name: Code Language: