I am working in replacing a text with a hyperlink in C#. The 开发者_JS百科problem here is..
Case 1:No problem
Input: ASAss12345
Output:ASAss12345
Case 2:Problem here
Input: ASAss12345
Output:ASAss12345'>ASAss12345
Preferred Output: ASAss12345
How can I rectify this problem. Code her for your reference.
mailItem.HTMLBody = Regex.Replace(mailItem.HTMLBody, "(?<!http://stack.com/=)ASA[a-z][a-z][0-9][0-9][0-9][0-9][0-9](?!</a>)", "<a href='http://stack.com/=$&'>$&</a>");
Take a look at this.
i think you are looking for This
精彩评论