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 05-11-2007, 11:38 AM
draymond draymond is online now
Registered User
 
Join Date: 04-16-2007
Posts: 6
Replace in File w/ Macro Value

Text or regular expression to find:

<row><td>C:\Build Area\1.2.3.4</td><td>

Text or regular expression to replace matches with:

<row><td>C:\Build Area\1.2.3.5</td><td>

I would like to replace 1.2.3.4 will the macro of the build version. I am uncertain how to use macros with the "Text or regular expression to replace matches with". Thanks.

UPDATE:
Use Text or regular expression to replace matches with:
<row><td>C:\Build Area\%MACRO_NAME%</td><td>

RELATED PROBLEM:
But how do I select just a select group of characters to replace?
<row><td>C:\Build Area\REPLACEME</td><td>

This does not work for me.
^<row><td>C:\Build Area\\.*?</td><td>$

Last edited by draymond; 05-11-2007 at 12:36 PM.
Reply With Quote
  #2  
Old 05-11-2007, 01:28 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See attached sample.
Attached Files
File Type: bld replace_ver.bld (873 Bytes, 1714 views)
Reply With Quote
  #3  
Old 05-11-2007, 06:07 PM
draymond draymond is online now
Registered User
 
Join Date: 04-16-2007
Posts: 6
Expression to look for:
(?<=<row><td>C:\\Build Area\\)((\d|\.)+)(?=</td><td>$)

Replacement Match
%VER%

I do not understand how the VBP software knows what to replace. From my understanding it should replace the entire line that it was looking for. But it only replaces the "((\d|\.)+)" group.
Reply With Quote
  #4  
Old 05-11-2007, 06:36 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
http://www.regular-expressions.info/lookaround.html
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 06:01 PM.


Copyright © 1999-2023 Kinook Software, Inc.