I have some simple regex that should replace @Username to
<a href="http://google.com">@Username</a>
Though its getting very odd results.
REGEX
var msg="@Mr.EasyBB";
msg.replace(/@(.+?)/g,
'<a href=\"http://'+window.location.host+'/u=$1\">$1</a>');
can someone help with this small issue results look like this
<a href="http://google.com">@U</a>sername
@Uand not@Usernameas a whole. I think I need to look ahead till white space. but not sure how/@(.+)?/g?is not greedy.(.+)will just do it.