I'm trying to insert into link (href) a matched substring but without the first char who are a '#'.
Infact I would like wrapp #hashtag with a link, that's working very good but when I using $& pattern, it return me the matched on the whole. I want take off the '#' in my href.
.replace(/#[a-z0-1A-Z]+/g, '<a href="https://twitter.com/search?q=**$&**">$&</a>');
It's possible to exclude the first char ?
Use group capture. And the capture will be at
$1