I have this string
@[123:peterwateber] hello! good day!
I wanna change it to <a href="123">peterwateber</a> <b>hellow!</b>! good day!
what I want to do first, from the given string, get first the @[123:peterwateber] convert it to an anchor tag and the remaining string with htmlspecialchars will be parsed to plain text. How to do this?
I did the first one using php by this code: preg_match('#@\[(\w+)\:(\w+)\]#', $hidden_input, $m) but I wanna do it in jquery or javascript this time… any suggestions? I badly need your help guys its been 3 days solving this problem 🙁
Regex replace in javascript