[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/RegExp/leftContext [Back]  [Original]

RegExp.leftContext ($`) - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

RegExp.leftContext ($`)

Deprecated

Avoid using this feature in new projects. The RegExp static properties may have unintended side effects. This feature may be a candidate for removal from web standards or browsers.

: RegExp RegExp

RegExp.leftContext RegExp["$`"]

leftContext RegExp RegExp RegExp.leftContext RegExp["$`"]

leftContext RegExp RegExp leftContext leftContext undefined

(RegExp.$` ) ` SyntaxError

$` String.prototype.replace() RegExp["$`"]

leftContext $`

js
const re = /world/g;
re.test("hello world!");
RegExp.leftContext; // "hello "
RegExp["$`"]; // "hello "

Legacy RegExp features
# additional-properties-of-the-regexp-constructor


Web Proxy Viewer  |  New URL  |  Original Page