Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

-Replace with "$"

1 view
Skip to first unread message

Martin Zugec

unread,
Dec 10, 2009, 7:30:49 AM12/10/09
to
Hi gents,

today I run into following problem - one of strings that I am manipulating
with contains "$" character. This can happen easily - it is UNC path with
hidden share:
"\\server\share$"

-Replace is not able to handle it:
"\\server\share$" -Replace "share$", "x"

System.String method Replace works fine - however is case sensitive :(

Any idea? Is it bug, or feature? :)

Thanks,
Martin

Martin Zugec

unread,
Dec 10, 2009, 7:33:31 AM12/10/09
to
As soon as I posted it, I realized why it doesn't work - it's regex after
all :)

-Replace "share\$", "x"

Martin

"Martin Zugec" <martin...@gmail.com> wrote in message
news:eqQlbSZe...@TK2MSFTNGP06.phx.gbl...

Larry__Weiss

unread,
Dec 10, 2009, 9:39:04 AM12/10/09
to

Also, if you are matching to a static pattern, it is better to use single quotes
to avoid accidental string expansion.

-Replace 'share\$', "x"

- Larry

Martin Zugec

unread,
Jan 4, 2010, 4:24:47 PM1/4/10
to
Suddenly, no static patterns in frameworks allowed :) Everything is XML
configuration based

Martin

"Larry__Weiss" <l...@airmail.net> wrote in message
news:eWFKIaae...@TK2MSFTNGP02.phx.gbl...

0 new messages