PDA

View Full Version : Replace in File w/ Macro Value


draymond
05-11-2007, 11:38 AM
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>$

kinook
05-11-2007, 01:28 PM
See attached sample.

draymond
05-11-2007, 06:07 PM
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.

kinook
05-11-2007, 06:36 PM
http://www.regular-expressions.info/lookaround.html