Easy Tutorial
❮ Prop Cssstyle Length Dom Obj Details ❯

JavaScript RegExp toString() Method

JavaScript RegExp Object

Example

Return the string value of the regular expression:

var patt = new RegExp("tutorialpro", "g");
var res = patt.toString();

Definition and Usage

The toString() method returns the string value of the regular expression.


Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method Chrome Edge Firefox Safari Opera
toString() Yes Yes Yes Yes Yes

Syntax

RegExpObject.toString()

Parameters

None.

Technical Details

Return Value: String.
JavaScript Version: ECMAScript 1
--- ---

JavaScript RegExp Object

❮ Prop Cssstyle Length Dom Obj Details ❯