Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-16-2006, 12:51 PM
mweinberger mweinberger is online now
Registered User
 
Join Date: 12-23-2005
Posts: 40
Replace in File: Multiline

Hi all,

I'm trying to replace a single line with multiple lines. If I press "Test", then all is fine, but as soon as I execute normally I consistantly get VBPro replacing my single line with nothing, effectively deleting the line. Here is some sample code.

==================
Source File To Operate On
==================
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.target s" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

========================
Text or regular expression to find:
========================
</Project>

====================================
Text or regular expression to replace matches with:
====================================
(?1 <Import Project="$(MSBuildExtensionsPath)\Microsoft\Assemb lyInfoTask\Microsoft.VersionNumber.Targets"/>
<PropertyGroup>
<AssemblyMajorVersion>1</AssemblyMajorVersion>
<AssemblyMinorVersion>0</AssemblyMinorVersion>
<AssemblyBuildNumberType>DateString</AssemblyBuildNumberType>
</PropertyGroup>
</Project>
)

What do you think the problem is and how do I work around this issue?

Thanks in advance,

M. Weinberger
Reply With Quote
  #2  
Old 02-16-2006, 01:19 PM
mweinberger mweinberger is online now
Registered User
 
Join Date: 12-23-2005
Posts: 40
The solution that I figured out is:

Playing with VBPro, I discovered the solutions.

1. I have to use parenthesis around the find expressions, so:

(</Project>)

2. I should use (for cleaner looking code) \r\n as new line characters in the replacement.

Hopefully this post helps somebody.

Me
ButterflyVista.com!
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 11:49 AM.


Copyright © 1999-2023 Kinook Software, Inc.