JavaScript RegExp toString()Method
Example
Returns the string value of the regular expression:
var patt = new RegExp("EXAMPLE", "g");
var res = patt.toString();
Try it yourself »
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 | |||||
|---|---|---|---|---|---|
| toString() | Yes | Yes | Yes | Yes | Yes |
Syntax
RegExpObject.toString()
Parameters
No parameters.
Technical Details
| Return value: | String. |
|---|---|
| JavaScript Version: | ECMAScript 1 |
Other Extensions
JavaScript RegExp Object