Jump to content
Sign in to follow this  
hisoka

understanding some symbols in replace function

Recommended Posts

var x = " hello w3schools how are you this is the site url http://w3schools.invisionzone.com"

var y = x.replace (<\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b>/g , '&lt;$1$2&gt;$3&lt;/$1&gt;')


 

 

could you please tell what do these symbols mean &lt;$1$2&gt;$3&lt;/$1&gt;   ?

 

Edited by hisoka

Share this post


Link to post
Share on other sites

The numbers after a dollar sign are different matches in the pattern.  The rest are part of the replacement text.

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×