Solved

Msbuild with Regex

Posted on 2011-09-02
1
1,055 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

752 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