From de5c456ebded0e038adbf23db34cc290c8829180 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:49:24 +0100 Subject: unslug pl: move --- .../global_objects/regexp/lastmatch/index.html | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 files/pl/web/javascript/reference/global_objects/regexp/lastmatch/index.html (limited to 'files/pl/web/javascript/reference/global_objects/regexp/lastmatch') diff --git a/files/pl/web/javascript/reference/global_objects/regexp/lastmatch/index.html b/files/pl/web/javascript/reference/global_objects/regexp/lastmatch/index.html new file mode 100644 index 0000000000..4d229d5d81 --- /dev/null +++ b/files/pl/web/javascript/reference/global_objects/regexp/lastmatch/index.html @@ -0,0 +1,54 @@ +--- +title: RegExp.lastMatch ($&) +slug: Web/JavaScript/Referencje/Obiekty/RegExp/lastMatch +translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/lastMatch +--- +
{{JSRef}} {{non-standard_header}}
+ +

Niestandardowa właściwość lastMatch jest właściwością statyczną, tylko do odczytu wyrażeń regularnych, który zawiera ostatnie dopasowane znaki. RegExp.$& jest aliasem tej właściwości.

+ +

Syntax

+ +
RegExp.lastMatch
+RegExp['$&']
+
+ +

Description

+ +

The lastMatch property is static, it is not a property of an individual regular expression object. Instead, you always use it as RegExp.lastMatch or RegExp['$&'].

+ +

The value of the lastMatch property is read-only and modified whenever a successful match is made.

+ +

You can not use the shorthand alias with the dot property accessor (RegExp.$&), because the parser expects an expression with "&" in that case and a {{jsxref("SyntaxError")}} is thrown. Use the bracket notation for property access.

+ +

Examples

+ +

Using lastMatch and $&

+ +
var re = /hi/g;
+re.test('hi there!');
+RegExp.lastMatch; // "hi"
+RegExp['$&'];     // "hi"
+
+ +

Specifications

+ +

Niestandardowe. Nie jest częścią aktualnej specyfikacji.

+ +

Browser compatibility

+ +
+ + +

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

+
+ +

See also

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