开发者

Problem with Regex to detect a hyperlink in C#

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜