Solved

Msbuild with Regex

Posted on 2011-09-02
1
1,025 Views
Last Modified: 2013-11-26
I am trying to write a target that looks at a svn_tag and sees if that includes the word -dev. I have done like below but I only get the output like this:

Regex:
12:40:44    Input : Build-1.0.0.154 Output :



 <Target Name="Regex">  
  <PropertyGroup>
  <Out>$([System.Text.RegularExpressions.Regex]::Match($(SVN_TAG), `-dev`))</Out>  
  </PropertyGroup>    
  <Message Text="Input : $(SVN_TAG) Output : $(Out)"/>  
 </Target>


How can I do this? Just need true or false answer.
0
Comment
Question by:Mickeys
1 Comment
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 500 total points
ID: 36472736
Change your line
<Out>$([System.Text.RegularExpressions.Regex]::Match($(SVN_TAG), `-dev`))</Out>

For this one:
<Out>$([System.Text.RegularExpressions.Regex]::Match($(SVN_TAG), `-dev`).Success.ToString())</Out>

Hope that helps.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question