From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/regexp/input/index.html | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/regexp/input/index.html (limited to 'files/ja/web/javascript/reference/global_objects/regexp/input') diff --git a/files/ja/web/javascript/reference/global_objects/regexp/input/index.html b/files/ja/web/javascript/reference/global_objects/regexp/input/index.html new file mode 100644 index 0000000000..5059ed7598 --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/regexp/input/index.html @@ -0,0 +1,67 @@ +--- +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 +--- +
{{JSRef}} {{non-standard_header}}
+ +

標準外の input プロパティは正規表現の一致している文字列を含む静的プロパティです。 RegExp.$_ はこのプロパティのエイリアスです。

+ +

解説

+ +

input プロパティは静的プロパティです。個々の正規表現オブジェクトのプロパティではありません。常に、 RegExp.input または RegExp.$_. として使用してください。

+ +

input プロパティの値は、正規表現の検索文字列が変更され文字列が一致しているときはいつでも変更されます。

+ +

Examples

+ +

input と $_ の使用

+ +
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!"
+
+ +

仕様書

+ + + + + + + + + + + + +
仕様書
{{SpecName('Legacy RegExp features')}}
+ +

ブラウザーの互換性

+ +
+ + +

{{Compat("javascript.builtins.RegExp.lastMatch")}}

+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf