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

RegExp.prototype.toString() - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

RegExp.prototype.toString()

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 ..

toString() .

In this article

regexObj.toString()

.

RegExp toString() Object; Object.prototype.toString(). RegExp, toString() .

: toString()

RegExp:

js
var myExp = new RegExp("a+b+c");
console.log(myExp.toString()); //  '/a+b+c/'

var foo = new RegExp("bar", "g");
console.log(foo.toString()); //  '/bar/g'

Specification
ECMAScript 2027 LanguageSpecification
# sec-regexp.prototype.tostring


Web Proxy Viewer  |  New URL  |  Original Page