Returns a string representing the specified object.
Method of RegExp
Syntax
toString()
Parameters
None.
Description
The RegExp object overrides the toString method of the Object object; it does not inherit Object.toString. For RegExp objects, the toString method returns a string representation of the object.
Examples
The following example displays the string value of a RegExp object: