Proxomitron(半)自作フィルタ

他のフィルタを参考にして(あるいは流用して)作ってみたフィルタ。
とりあえず1個だけ公開してみる。

YouTube動画へのテキストリンクに動画開閉リンクを追加する

動画埋め込みではなく、動画ページへのテキストリンクが張られている場合に、その場でその動画をiFrameに呼び出す。[*]をクリックすると動画が表示され、[x]をクリックすると非表示になる。
まだ作りたてなのでこなれてないし、YouTube限定。

[Patterns]
Name = "YouTube Inline"
Active = TRUE
Bounds = "$NEST(<a(\s[^>]++)\#href=$AV(\9)\#>,</a>)"
Limit = 1024
Match = "<a\s[^>]++href=$AV(http://(www|jp)\0.youtube.com/watch\?v=\1)[^>]++>\2</a>"
        "$SET(YT=$GET(YT)a)"
Replace = "<a id="$GET(YT)*""
          " href="http://\0.youtube.com/v/\1""
          " title="Open""
          " target="$GET(YT)""
          " onClick="document.getElementById('$GET(YT)b').style.display='block';"
          " document.getElementById('$GET(YT)x').style.display='inline';"
          " this.style.display='none'""
          " style="color:red;">[*]</a>"
          "<a id="$GET(YT)x""
          " href="#$GET(YT)""
          " title="Close""
          " onClick="document.getElementById('$GET(YT)b').style.display='none';"
          " this.style.display='none';"
          " document.getElementById('$GET(YT)*').style.display='inline';""
          " style="display:none; color:red;">[x]</a>"
          "<a href="\9"\@>\2</a>"
          "<div id="$GET(YT)b" style="display:none;">"
          "<iframe src="" name="$GET(YT)" width="425" height="344"></iframe>"
          "</div>"
テスト用リンク
テキスト