Replace whole word with a symbol using C# Regex -
so trying replace word @theplace
or @theplaces
using regex pattern like:
string pattern = string.format(@"\b{0}\b", placename);
but when replacement, not finding pattern, guessing @
symbol problem.
can show me need regex pattern work?
your problem* \b
(word boundary) before @
. there no word boundary between space , @
.
you remove it, or replace non-boundary, capital b
.
string pattern = string.format(@"\b{0}\b", placename);
* assuming placename
begins @
.
Comments
Post a Comment