No announcement yet.

Replacements my best option...?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Replacements my best option...?

    What I'm trying to do is to ignore known differences such as file paths.

    I added one replacement item which seems to work, but the second one I'm getting burned by. Here is the first one:
    Text to find: c:\\inetpub\\wwwroot\\
    Replace with: c:\\Web\\allyourbaserbelongtous\\
    Regular expression: yes
    Side: left
    use for all files within the parent session.

    Basically the same idea given here:
    (Thanks for the post Craig)

    My problem is something like this.
    2 Full lines from left file to match:
    <script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="/scripts/jquery-1.3.2.min.js"></script>
    2 Full lines from right file to match:
    <script type="text/javascript" src="/Resource/scripts/js/jquery/jquery-1.6.4.min.js"></script>
    <script type="text/javascript" src="/Resource/scripts/js/formField.js"></script>

    Now the replacements addition:
    Text to find:
    Replace with:
    Regular expression: yes
    Side: Left

    Not sure why this fails. Also I tried copying the entire line from start to finish and just modified the portion to /scripts/.*\.js for the left and /Resource/.*\.js and still there was no match.

    What regular expression engine is in use with BC? I used RegexBuddy to test what failed and I can't figure out what was done wrong.

    Also, I have perhaps encountered a bug in the Replacements Screen in the Session Settings. It appears that if text is longer than the size of the frame available then no text is displayed. A blank spot will populate the available area for that Replacement Item.

  • #2

    The "Right" or destination Replacement does not have access to .* or other methods of masking. BC3 only supports $1 or other back-references. Any different text must be explicitly defined, such as (jquery)-1.3.2 = $1-1.6.4 or left out, such as jquery-1.3.2 = jquery translating to: (jquery)-1.3.2 = $1. You can see the list of supported commands in the dropdown control on the right of each of the Left and Right textboxes.

    Would it be possible to get a screenshot of the blank spot bug? I tried reproducing this with the long strings above, but they simply appeared visible in the space available as expected.
    Aaron P Scooter Software