aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html')
-rw-r--r--files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html87
1 files changed, 0 insertions, 87 deletions
diff --git a/files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html b/files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html
deleted file mode 100644
index ce94abd766..0000000000
--- a/files/ja/web/javascript/reference/global_objects/regexp/lastindex/index.html
+++ /dev/null
@@ -1,87 +0,0 @@
----
-title: RegExp.lastIndex
-slug: Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex
-tags:
- - JavaScript
- - Property
- - Reference
- - RegExp
- - Regular Expression
-translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex
----
-<div>{{JSRef}}</div>
-
-<p><strong><code>lastIndex</code></strong> は正規表現インスタンスの読み書き可能なプロパティで、次の一致を開始する位置を指定します。</p>
-
-<div>{{EmbedInteractiveExample("pages/js/regexp-lastindex.html")}}</div>
-
-<div>{{js_property_attributes(1, 0, 0)}}</div>
-
-<h2 id="Syntax" name="Syntax">構文</h2>
-
-<pre class="syntaxbox"><code><var>regExpObj</var>.lastIndex</code></pre>
-
-<h2 id="Description" name="Description">解説</h2>
-
-<p>このプロパティは、正規表現インスタンスがグローバル検索を示すために <code>g</code> フラグを使用した場合、または粘着的検索を示すために <code>y</code> フラグを使用した場合にのみ設定されます。以下の規則が適用されます。</p>
-
-<ul>
- <li><code>lastIndex</code> が文字列の長さよりも大きければ、 {{jsxref("RegExp.prototype.test()", "test()")}} および {{jsxref("RegExp.prototype.exec()", "exec()")}} は失敗し、<code>lastIndex</code> は 0 にセットされます。</li>
- <li><code>lastIndex</code> が文字列の長さ以下で、かつ正規表現が空文字列に一致する場合には、正規表現は <code>lastIndex</code> から始まる入力に一致します。</li>
- <li><code>lastIndex</code> が文字列の長さと等しく、かつ、正規表現が空文字列に一致しない場合、正規表現は入力に一致せず、 <code>lastIndex</code> は 0 にリセットされます。</li>
- <li>それ以外の場合は、 <code>lastIndex</code> は直近の一致に続く次の位置に設定されます。</li>
-</ul>
-
-<h2 id="Examples" name="Examples">例</h2>
-
-<h3 id="lastIndex_の使用">lastIndex の使用</h3>
-
-<p>例えば、以下の連続した処理を考えてみてください。:</p>
-
-<pre class="brush: js">var re = /(hi)?/g;
-</pre>
-
-<p>空文字列に一致します。</p>
-
-<pre class="brush: js">console.log(re.exec('hi'));
-console.log(re.lastIndex);
-</pre>
-
-<p><code>lastIndex</code> が 2 になり<code>["hi", "hi"]</code> が返ります。</p>
-
-<pre class="brush: js">console.log(re.exec('hi'));
-console.log(re.lastIndex);
-</pre>
-
-<p>ゼロ番目の要素が一致した文字列なので、 <code>["", undefined]</code> という空配列が返ります。この場合、 <code>lastIndex</code> が 2 であったときに (そして 2 のままである)、 <code>hi</code> の長さが 2 であるので、空文字列になります。</p>
-
-<h2 id="Specifications" name="Specifications">仕様書</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th scope="col">仕様書</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>{{SpecName('ESDraft', '#sec-properties-of-regexp-instances', 'RegExp.lastIndex')}}</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
-
-<div>
-<p>{{Compat("javascript.builtins.RegExp.lastIndex")}}</p>
-</div>
-
-<h2 id="See_also" name="See_also">関連情報</h2>
-
-<ul>
- <li>{{jsxref("RegExp.prototype.ignoreCase")}}</li>
- <li>{{jsxref("RegExp.prototype.global")}}</li>
- <li>{{jsxref("RegExp.prototype.multiline")}}</li>
- <li>{{jsxref("RegExp.prototype.source")}}</li>
- <li>{{jsxref("RegExp.prototype.sticky")}}</li>
-</ul>