JavaScript RegExp toString Method
Clash Royale CLAN TAG#URR8PPP
<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]-->
JavaScript RegExp toString Method
❮ JavaScript RegExp Object
Example
Return the string value of the regular expression:
var patt = new RegExp("Hello World", "g");
var res = patt.toString();
<!--
The result of res will be:
/Hello World/g
-->Try it Yourself »
Definition and Usage
The toString() method returns the string value of the regular expression.
Browser Support
Method | |||||
---|---|---|---|---|---|
toString() | Yes | Yes | Yes | Yes | Yes |
Syntax
RegExpObject.toString()
Parameters
None. |
Return Value
Type | Description |
---|---|
String | The string value of the regular expression |
Technical Details
JavaScript Version: | ECMAScript 1 |
---|
❮ JavaScript RegExp Object