regex - MSBuild Community Taks RegexReplace remove trailing slash from path -
i trying use msbuild community tasks remove slash end of outputpath
this have far.
<regexreplace input="$(outputpath)" expression="\$" replacement="" count="1"> <output itemname="formattedoutputpath" taskparameter="output" /> </regexreplace> <message text="@(formattedoutputpath)"/>
unfortunately message returns path still slash on end. path c:\mydirectory\
it looks expression incorrect
can help?
slash using escape character, in pattern have escape slash character slash:
<regexreplace input="$(outputpath)" expression="\\$" replacement="" count="1"> <output itemname="formattedoutputpath" taskparameter="output" /> </regexreplace> <message text="@(formattedoutputpath)"/>
to better understand escaping see following examples:
$
represents end of line/string\$
represents dollar sign character\\
represents slash character\\$
represents slash character @ end of line/string
Comments
Post a Comment