Solved

Msbuild with Regex

Posted on 2011-09-02
1
978 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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 NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now