var input ="leoshi\nSample text for testing:<a href=\"http://w...content-available-to-author-only...u.com\" title=\"leoshi\">leoshi</a>leoshi for details balala...";
var pattern =/<a.*?>.*leoshi.*<\/a>|(leoshi)/;
var match = pattern.exec(input);
var inputMatches = match !==null&& match[1]!==null;