c# - Replacing a String with Regular expression -


suppose have text "hello @c1, please go here , play @c12, @c1 goes , plays", write pattern replace of @c1 value in same time regular expression must not change @c12 or @c123 etc.. should replace matched string. have been trying hours, failing produce right output, can can me regarding articles or code samples

i using .net framework writing regular expression

you can use regex:

@c1\b 

working demo

enter image description here

the idea use word boundary after text , solve problem


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -