regex - how do I replace nonrepeating character through .Net regular expression -


I have the string using Regex, I want to replace "D" with "DD". Replay, but only if D is not repeating. For example, if the string is "m / d / yy" then I want to change it to "m / dd / yy" However, if the string is "m / dd / yy" then I want to keep it the same , And not want to change it in "m / dddd / yy"

How can I do this? I tried Reg.Replace (datePattern, "\ bd \ b", "dd"), but that does not seem to work.

(.) (? & Lt;! \ 1) (?!! 1)

literally means "character, neither nor after itself".


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -