Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2012
    Posts
    2

    Default 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:
    http://stackoverflow.com/questions/5...n-text-strings
    (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:
    "/scripts/.*\.js
    Replace with:
    "/Resource/.*\.js
    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. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,788

    Default

    Hello,

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •