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

RegExp.$1, , RegExp.$9 - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

RegExp.$1, , RegExp.$9

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.$1, , RegExp.$9

$1$9 RegExp RegExp.$1, RegExp.$2, RegExp

$1, , $9 RegExp RegExp undefined

RegExp 9

$1, , $9 String.prototype.replace() RegExp.$n

$n RegExp.prototype.test()

RegExp.prototype.test()

js
const str = "Test 24";
const number = /(\d+)/.test(str) ? RegExp.$1 : "0";
number; // "24"

re.test(str) RegExp.$n

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


Web Proxy Viewer  |  New URL  |  Original Page