aboutsummaryrefslogtreecommitdiff
path: root/files/pl/web/javascript/reference/global_objects/regexp/lastmatch
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 14:49:24 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 14:49:24 +0100
commitde5c456ebded0e038adbf23db34cc290c8829180 (patch)
tree2819c07a177bb7ec5f419f3f6a14270d6bcd7fda /files/pl/web/javascript/reference/global_objects/regexp/lastmatch
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-de5c456ebded0e038adbf23db34cc290c8829180.tar.gz
translated-content-de5c456ebded0e038adbf23db34cc290c8829180.tar.bz2
translated-content-de5c456ebded0e038adbf23db34cc290c8829180.zip
unslug pl: move
Diffstat (limited to 'files/pl/web/javascript/reference/global_objects/regexp/lastmatch')
-rw-r--r--files/pl/web/javascript/reference/global_objects/regexp/lastmatch/index.html54
1 files changed, 54 insertions, 0 deletions
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
+---
+<div>{{JSRef}} {{non-standard_header}}</div>
+
+<p>Niestandardowa właściwość <strong>lastMatch</strong> jest właściwością statyczną, tylko do odczytu wyrażeń regularnych, który zawiera ostatnie dopasowane znaki. <code>RegExp.$&amp;</code> jest aliasem tej właściwości.</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><var>RegExp</var>.lastMatch
+RegExp['$&amp;']
+</pre>
+
+<h2 id="Description">Description</h2>
+
+<p>The <code>lastMatch</code> property is static, it is not a property of an individual regular expression object. Instead, you always use it as <code>RegExp.lastMatch</code> or <code>RegExp['$&amp;'].</code></p>
+
+<p>The value of the <code>lastMatch</code> property is read-only and modified whenever a successful match is made.</p>
+
+<p>You can not use the shorthand alias with the dot property accessor (<code>RegExp.$&amp;</code>), because the parser expects an expression with "&amp;" in that case and a {{jsxref("SyntaxError")}} is thrown. Use the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors">bracket notation for property access</a>.</p>
+
+<h2 id="Examples">Examples</h2>
+
+<h3 id="Using_lastMatch_and">Using <code>lastMatch</code> and <code>$&amp;</code></h3>
+
+<pre class="brush: js">var re = /hi/g;
+re.test('hi there!');
+RegExp.lastMatch; // "hi"
+RegExp['$&amp;']; // "hi"
+</pre>
+
+<h2 id="Specifications">Specifications</h2>
+
+<p>Niestandardowe. Nie jest częścią aktualnej specyfikacji.</p>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<div>
+
+
+<p>{{Compat("javascript.builtins.RegExp.lastMatch")}}</p>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{non-standard_inline}} {{jsxref("RegExp.input", "RegExp.input ($_)")}}</li>
+ <li>{{non-standard_inline}} {{jsxref("RegExp.lastParen", "RegExp.lastParen ($+)")}}</li>
+ <li>{{non-standard_inline}} {{jsxref("RegExp.leftContext", "RegExp.leftContext ($`)")}}</li>
+ <li>{{non-standard_inline}} {{jsxref("RegExp.rightContext", "RegExp.rightContext ($')")}}</li>
+ <li>{{non-standard_inline}} {{jsxref("RegExp.n", "RegExp.$1-$9")}}</li>
+</ul>