Replacements my best option...?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sn3akyP3t3
    Visitor
    • Feb 2012
    • 3

    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.
  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    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

    Comment

    Working...