My current code is like this:
var regex = '@([a-z0-9_]+)';
replacedText = replacedText.replace(regex, '<a href="http://blah.com/$1">$1</a>');
However, when I type a sentence like 'hello this is @test!' it doesn't change anything and it still shows in plain text.
Why is this happening?