0

メンションが多い文字列をリンクに置き換えたい

string comment = "@David you are best friend of @fri.tara3 and best of @mahta_";

string  pattern = "@[a-zA-Z0-9_.]+?(?![a-zA-Z0-9_.])";

私が欲しいのは次のようなものです:

<a href="http://Domain.com/David">@David</a> you are best friend of <a href="http://Domain.com/fri.tara3_">@fri.tara3_</a>

ちなみに、forやforeachは使いたくない...

どうもありがとうございました

4

1 に答える 1