<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-62436504872257411</id><updated>2011-09-20T03:42:44.003+09:00</updated><category term='XSLT'/><category term='Windows'/><category term='JavaScript'/><category term='XPath'/><category term='HTML'/><title type='text'>refluxflow::memo</title><subtitle type='html'>&lt;a href="http://refluxflow.net/"&gt;reflux flow&lt;/a&gt;のメモ。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://refluxflow.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-4706394931661092111</id><published>2007-09-12T22:59:00.000+09:00</published><updated>2007-09-12T23:01:00.436+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>JavaScriptの正規表現における「.(dot)」</title><content type='html'>&lt;p&gt;FirefoxやOperaでは、正規表現の「.(dot)」は改行を除く任意の文字にマッチします（IEでは改行を含む任意の文字にマッチします）。ECMAScript（&lt;a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm"&gt;ECMA-262&lt;/a&gt;）では、「.」は改行を含まないことになっているので、規格通りの挙動と言えます。&lt;/p&gt;
&lt;p&gt;では、改行を含むすべての文字にマッチさせたいときはどうすれば良いのでしょう？&lt;code&gt;[\S\s]&lt;/code&gt;のように書けば任意の文字にマッチしますが、あまりスマートな表現ではない気がします。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-4706394931661092111?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=4706394931661092111' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/4706394931661092111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/4706394931661092111'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/09/javascriptdot.html' title='JavaScriptの正規表現における「.(dot)」'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-361468341482665819</id><published>2007-09-09T20:02:00.000+09:00</published><updated>2007-11-18T14:11:29.508+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><title type='text'>文字列リテラルにマッチする正規表現</title><content type='html'>&lt;p&gt;JavaScriptの正規表現で、文字列リテラル（引用符「"」で囲まれた文字列、例えば、"abc"）に一致するパターンを考えてみた。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/".*?"/&lt;/code&gt;で済めば良いのだが、これでは文字列中にエスケープされた引用符（\"）が存在する場合に対処できない。文字列を閉じる引用符の直前にバックスラッシュ（\）が無ければ良いと考えて&lt;code&gt;/".*?[^\\]"/&lt;/code&gt;としてみるも、今度はバックスラッシュがエスケープされていた場合（例えば、"abc\\"）に対処できない。&lt;/p&gt;
&lt;p&gt;試行錯誤の結果、&lt;code&gt;/"(.*?[^\\])??(\\\\)*"/&lt;/code&gt;という結論に至った。前半が「(...)??」という形になっているのは「""」や「"\\"」にもマッチさせるため。&lt;/p&gt;
&lt;h4&gt;追記（2007-10-19）&lt;/h4&gt;
&lt;p&gt;コメントでもっと良い表現を教えていただきました。教えていただいたのはJavaの正規表現で、JavaScriptの正規表現リテラルに直すと&lt;code&gt;/"([^\\"]|\\.)*?"/&lt;/code&gt;となります。&lt;/p&gt;
&lt;h4&gt;追記（2007-11-18）&lt;/h4&gt;
&lt;p&gt;上記の正規表現ですが、「&lt;code&gt;[^\\"]&lt;/code&gt;」の部分でエスケープされていない「"」を含まないようになっているので、「&lt;code&gt;(...)*?&lt;/code&gt;」のように「&lt;code&gt;*?&lt;/code&gt;」を使う必要はなく、「&lt;code&gt;*&lt;/code&gt;」で十分です。つまり、文字列リテラルに一致する正規表現は&lt;code&gt;/"([^\\"]|\\.)*"/&lt;/code&gt;となります。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-361468341482665819?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=361468341482665819' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/361468341482665819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/361468341482665819'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/09/blog-post.html' title='文字列リテラルにマッチする正規表現'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-6199018410422680173</id><published>2007-09-06T20:06:00.000+09:00</published><updated>2007-09-06T20:08:53.346+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>Windows XPでハードリンクを作成する</title><content type='html'>&lt;p&gt;以下のコマンドで&lt;a href="http://e-words.jp/w/E3838FE383BCE38389E383AAE383B3E382AF.html" title="ハードリンク - IT用語辞典 e-Words"&gt;ハードリンク&lt;/a&gt;を作成できる。&lt;/p&gt;
&lt;pre&gt;fsutil hardlink create &lt;var&gt;新しいファイル&lt;/var&gt; &lt;var&gt;既存のファイル&lt;/var&gt;&lt;/pre&gt;
&lt;p&gt;ただし、ファイルシステムがNTFSの場合のみ。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-6199018410422680173?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=6199018410422680173' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/6199018410422680173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/6199018410422680173'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/09/windows-xp.html' title='Windows XPでハードリンクを作成する'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-126859672550236922</id><published>2007-08-19T17:47:00.000+09:00</published><updated>2007-08-19T17:51:34.114+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><title type='text'>すべてのコマンドライン引数に対して処理を行うバッチファイルの作成</title><content type='html'>&lt;p&gt;ドラッグ&amp;amp;ドロップされたすべてのファイルに対して処理を行うバッチファイルの書き方について。&lt;/p&gt;
&lt;p&gt;バッチファイルのコマンドライン引数は&lt;code&gt;%&lt;var&gt;n&lt;/var&gt;&lt;/code&gt;（&lt;var&gt;n&lt;/var&gt;は0から9までの数字。ただし、&lt;code&gt;%0&lt;/code&gt;はバッチファイル自身）で参照できる。しかし、この方法では&lt;code&gt;%1&lt;/code&gt;から&lt;code&gt;%9&lt;/code&gt;の9つの引数しか扱えない。そこで、&lt;code&gt;goto&lt;/code&gt;コマンドを使ったループと&lt;code&gt;shift&lt;/code&gt;コマンドを用いて、すべてのコマンドライン引数を処理する。&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;:loop

if "%~1" == "" goto end

rem ここに%1に対して処理を書く。例えば次のように。
&lt;em&gt;echo %1&lt;/em&gt;

shift

goto loop

:end&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;「&lt;code&gt;echo %1&lt;/code&gt;」のところに処理を記述する（ここでは単に%1の内容を出力しているだけ）。&lt;/p&gt;
&lt;p&gt;コマンドライン引数が確実に1つ以上あるとわかっている場合は以下のようにも書ける。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:loop

&lt;em&gt;echo %1&lt;/em&gt;

shift

if not "%~1" == "" goto loop&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;%1が空かどうかを判定するところで&lt;code&gt;%~1&lt;/code&gt;としているのは、%1の内容から引用符（"）を取り除くため。そうしないと%1が引用符で囲まれている場合（例えば、空白文字を含むパスが渡されたとき）にうまく処理されない。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-126859672550236922?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=126859672550236922' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/126859672550236922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/126859672550236922'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/08/blog-post.html' title='すべてのコマンドライン引数に対して処理を行うバッチファイルの作成'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-1084553075131786841</id><published>2007-03-04T14:20:00.001+09:00</published><updated>2007-05-22T16:24:54.241+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>HTML/XHTML 関連仕様書一覧</title><content type='html'>&lt;p&gt;移動しました。&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://refluxflow.net/2007/05/html-spec.html"&gt;HTML/XHTML仕様書リンク集 - reflux flow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!--
&lt;p&gt;メモ。&lt;/p&gt;
&lt;h4&gt;原典（英語）&lt;/h4&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/html4" title="HTML 4の最新版"&gt;HTML 4&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/1999/REC-html401-19991224"&gt;HTML 4.01（1999-12-24）&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml1" title="XHTML 1.0の最新版"&gt;XHTML 1.0&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/2000/REC-xhtml1-20000126"&gt;XHTML 1.0（2000-01-26）&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/2002/REC-xhtml1-20020801"&gt;XHTML 1.0 Second Edition（2002-08-01）&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml-modularization" title="Modularization of XHTMLの最新版"&gt;Modularization of XHTML&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/2001/REC-xhtml-modularization-20010410"&gt;Modularization of XHTML（2001-04-10）&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml-basic" title="XHTML Basicの最新版"&gt;XHTML Basic&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/2000/REC-xhtml-basic-20001219"&gt;XHTML Basic（2000-12-19）&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml11" title="XHTML 1.1の最新版"&gt;XHTML 1.1&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/2001/REC-xhtml11-20010531"&gt;XHTML 1.1（2001-05-31）&lt;/a&gt;&lt;/li&gt;
   &lt;li&gt;&lt;a href="http://www.w3.org/TR/ruby" title="Ruby Annotationの最新版"&gt;Ruby Annotation&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml-print" title="XHTML-Printの最新版"&gt;XHTML-Print&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.w3.org/TR/xhtml2" title="XHTML 2.0の最新版"&gt;XHTML 2.0&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;日本語訳&lt;/h4&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;a href="http://www.asahi-net.or.jp/%7Esd5a-ucd/rec-html401j/cover.html"&gt;HTML 4.01&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.doraneko.org/webauth/xhtml10/20000126/Overview.html"&gt;XHTML 1.0&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.doraneko.org/webauth/xhtmlbasic/20001219/Overview.html"&gt;XHTML Basic&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://www.doraneko.org/webauth/xhtml11/20010531/Overview.html"&gt;XHTML 1.1&lt;/a&gt;
  &lt;ul&gt;
   &lt;li&gt;&lt;a href="http://www.doraneko.org/webauth/ruby/20010531/Overview.html"&gt;Ruby Annotation&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
 &lt;/li&gt;
&lt;/ul&gt;
--&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-1084553075131786841?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=1084553075131786841' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/1084553075131786841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/1084553075131786841'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/03/htmlxhtml.html' title='HTML/XHTML 関連仕様書一覧'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-62436504872257411.post-2784874007752860248</id><published>2007-03-03T16:41:00.000+09:00</published><updated>2011-09-19T13:43:01.472+09:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='XSLT'/><title type='text'>XSLT &amp; XPath 仕様書一覧</title><content type='html'>&lt;p&gt;以下のページに移動しました。&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://refluxflow.net/2011/09/xml-spec.html"&gt;http://refluxflow.net/2011/09/xml-spec.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/62436504872257411-2784874007752860248?l=refluxflow.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=62436504872257411&amp;postID=2784874007752860248' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/2784874007752860248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/62436504872257411/posts/default/2784874007752860248'/><link rel='alternate' type='text/html' href='http://refluxflow.blogspot.com/2007/03/xslt-xpath.html' title='XSLT &amp;amp; XPath 仕様書一覧'/><author><name>Rf</name><uri>http://www.blogger.com/profile/00155416751705993737</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
