Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-04-2006, 09:34 PM
mweinberger mweinberger is online now
Registered User
 
Join Date: 12-23-2005
Posts: 40
Multiple Regular Expressions & Case Sensitive

Hi,

1. Topic One (Multiple Indendent Expressions)

I'm a registered user of VBPro v6.1 and have a question on regular expressions. I want to create a single "Replace in File" action that operates on a single file. I would like 5 independent search and replaces performed. The way that I'm envissioning things is that each line in the "Text or regular expression to find:" box would match a line in the "Text or regular expression to replace matches with:".

"Text or regular expression to find:"
=========================
FILEVERSION\s.*
PRODUCTVERSION\s.*
"FileVersion", ".*
"ProductVersion", ".*
"LegalCopyright", ".*
=========================

"Text or regular expression to replace matches with:"
======================================
FILEVERSION %VERSION_IMMOD_FILE%
PRODUCTVERSION %VERSION_IMMOD_PRODUCT%
"FileVersion", "%VERSION_IMMOD_FILE%"
"ProductVersion", "%VERSION_IMMOD_PRODUCT%"
"LegalCopyright", "%LEGALCOPY_IMMOD%"
======================================

As you can see there are five independent search and replaces. I tried what you see above and it didn't work. I seem to recall that I have to add something. I just don't remember what.

2. Topic Two (Case Sensitive Expressions)

How can I make the search for a particular expression case senstive. The "fileversion" in the expression (FILEVERSION\s.*) is different than the "fileversion" in the expression ("FileVersion", ".*).

Thanks in advance,
Reply With Quote
  #2  
Old 07-05-2006, 08:01 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Another way to do that would be to use a Make VC6 or Make VS.NET action, setting the values on the Versions and Properties tabs (you can specify a .rc file or .dsp/.dsw/.vcproj/.sln for the filename to process).

To perform multiple regular expression replacements w/ the Replace in File action, see the Fixup RC File step in the Files.bld sample and http://www.visualbuild.com/Manual/replacetexttab.htm

To perform case sensitive matching, check the 'Perform case-sensitive matching' on the Replace tab: http://www.visualbuild.com/Manual/replacetab.htm
Reply With Quote
  #3  
Old 07-05-2006, 09:00 AM
mweinberger mweinberger is online now
Registered User
 
Join Date: 12-23-2005
Posts: 40
She works! Thanks! The only problem that I had is that there cannot be any embedded carriage returns between the () blocks in the find and the (?#) blocks in the replace with areas.
Reply With Quote
  #4  
Old 07-05-2006, 09:35 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See the 'Allow comments and ignore whitespace (Perl extended mode)' option.
http://www.visualbuild.com/Manual/replacetab.htm
Reply With Quote
Reply


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 02:50 PM.


Copyright © 1999-2023 Kinook Software, Inc.