blob: f1599cfa50c7a6ecd99dbf9bba43191dc56dce98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
---
title: RegExp.input ($_)
slug: Web/JavaScript/Reference/Global_Objects/RegExp/input
tags:
- JavaScript
- Non-standard
- Property
- Reference
- RegExp
- Regular Expressions
translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/input
---
<div>{{JSRef}} {{non-standard_header}}</div>
<p>標準外の <strong><code>input</code></strong> プロパティは正規表現の一致している文字列を含む静的プロパティです。 <code>RegExp.$_</code> はこのプロパティのエイリアスです。</p>
<h2 id="Description" name="Description">解説</h2>
<p><code>input</code> プロパティは静的プロパティです。個々の正規表現オブジェクトのプロパティではありません。常に、 <code>RegExp.input</code> または <code>RegExp.$_.</code> として使用してください。</p>
<p><code><strong>input</strong></code> プロパティの値は、正規表現の検索文字列が変更され文字列が一致しているときはいつでも変更されます。</p>
<h2 id="Examples">Examples</h2>
<h3 id="Using_lastIndex" name="Using_lastIndex">input と $_ の使用</h3>
<pre class="brush: js notranslate">var re = /hi/g;
re.test('hi there!');
RegExp.input; // "hi there!"
re.test('foo'); // new test, non-matching
RegExp.$_; // "hi there!"
re.test('hi world!'); // new test, matching
RegExp.$_; // "hi world!"
</pre>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('Legacy RegExp features')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<div>
<p>{{Compat("javascript.builtins.RegExp.lastMatch")}}</p>
</div>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{jsxref("RegExp.lastMatch", "RegExp.lastMatch ($&)")}}</li>
<li>{{jsxref("RegExp.lastParen", "RegExp.lastParen ($+)")}}</li>
<li>{{jsxref("RegExp.leftContext", "RegExp.leftContext ($`)")}}</li>
<li>{{jsxref("RegExp.rightContext", "RegExp.rightContext ($')")}}</li>
<li>{{jsxref("RegExp.n", "RegExp.$1-$9")}}</li>
</ul>
|