Replacement item using Regular expression on both side

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GlenC
    New User
    • Nov 2012
    • 2

    Replacement item using Regular expression on both side

    Hi,

    I have a text file compare with left side text of:
    Code:
                <div id="n01">
                    <input name="p_topic" value="FTBL" onClick="checkboxChange(this)" id="n01_topicId" type="checkbox" checked="checked">
                    <label for="n01_topicId">Football</label>
                </div>
                <div id="n02">
                    <input name="p_topic" value="SWMG" onClick="checkboxChange(this)" id="n02_topicId" type="checkbox" checked="checked">
                    <label for="n02_topicId">Swimming</label>
                </div>
    and right side text of:
    Code:
                <div id="n06">
                    <input name="p_topic" value="FTBL" onClick="checkboxChange(this)" id="n06_topicId" type="checkbox" checked="checked">
                    <label for="n06_topicId">Football</label>
                </div>
                <div id="n03">
                    <input name="p_topic" value="SWMG" onClick="checkboxChange(this)" id="n03_topicId" type="checkbox" checked="checked">
                    <label for="n03_topicId">Swimming</label>
                </div>
    (my full file has many more groups of this code)

    I'm trying to confirm the text is the same except wherever n<number><number> if found.

    I've tried a Replacement Item with Text to find being [0-9]* and Replace with also being [0-9]* (and Regular expression checkbox set, and Left radio set)(see attached screenshot). This doesn't seem to work (i.e. n01 and n02 on left and n06 and n03 on right aren't marked as unimportant differences).

    I also tried adding two Replacement Items with Text to find as [0-9]* and Replace with as xxxx (with Regular expression checked). I set this up as both a left and a right replacement, hoping Beyond Compare would apply the replacement from the first rule, then apply the second rule and show xxxx values in the comparison that are equal. This didn't work either.

    Is there another way to accomplish this task (inside beyond compare)? If not could either of these features (allow regular expression on both find and replace side or/and add an option for the replacement rule to forcefully apply the change as soon as the rule is met, in order of being applied) be a future option in Beyond compare?

    Thanks
    Last edited by GlenC; 18-Nov-2012, 06:24 PM.
  • Aaron
    Team Scooter
    • Oct 2007
    • 16002

    #2
    Hello,

    Supporting the RegEx on both sides is on our wishlist but is not supported at this time. If you click the little dropdown arrow to the right of the textbox, you can see the supported RegEx commands for that textbox. The Replace With box does not support \d or other masking, and would require specifying the number.

    If you need to generally mark any "n\d\d" as unimportant, please try using our Unimportant grammar definitions.
    http://www.scootersoftware.com/suppo..._unimportantv3

    Please let us know if you have any questions.
    Aaron P Scooter Software

    Comment

    • GlenC
      New User
      • Nov 2012
      • 2

      #3
      Thanks Aaron,

      Though a couple more steps than allowing regular expressions on both sides for just this one session the unimportant grammar achieves what is required.

      Thanks again.

      Comment

      Working...