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

RegExp.prototype.compile() - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

RegExp.prototype.compile()

Deprecated

Avoid using this feature in new projects. The compile() method duplicates behavior of the RegExp() constructor and it exists only for backwards compatibility. This feature may be a candidate for removal from web standards or browsers.

: compile() compile() RegExp()

compile() RegExp RegExp

js
compile(pattern, flags)

pattern

flags

(undefined)

compile()

js
const regexObj = /foo/gi;
regexObj.compile("new foo", "g");

ECMAScript 2027 LanguageSpecification
# sec-regexp.prototype.compile


Web Proxy Viewer  |  New URL  |  Original Page