JavaScript RegExp toString() method
Example
Returns the string value of the regular expression:
var
patt
=
new
RegExp
(
"
RUNOOB
"
,
"
g
"
)
;
var
res
=
patt
.
toString
(
)
;
Try it »
Definition and Usage
The toString() method returns the string value of the regular expression.
Browser support
The numbers in the table indicate the first browser version that supports this method.
| Method | |||||
|---|---|---|---|---|---|
| toString() | Yes | Yes | Yes | Yes | Yes |
Syntax
RegExpObject.toString()
Parameters
No parameters.
Technical Details
| Return value: | The string. |
|---|---|
| JavaScript version: | ECMAScript 1 |
JavaScript RegExp Object