Javatpoint Logo
Javatpoint Logo

JavaScript RegExp.prototype.toString() Method

The toString() method returns a string which represents the regular expression.

Syntax

Parameters

NA

Return value

This method returns the string representing the given object.

Example 1

Test it Now

Output:

Returned value : /(?:)/g

Example 2

Test it Now

Output:

/a+b+c/g/
gt+yu//
abcd//
\n/g

Example 3

Test it Now

Output:

Returned value : /script/g	
Returned value : /(?:)/g
Next TopicJavaScript RegExp




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA