No announcement yet.

Grammar only applying to one side of comparison.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Grammar only applying to one side of comparison.

    I am using Beyond Compare 4 to compare SQL files generate with and without the "IF NOT EXISTS" clause.

    On one side, you will have 2 single quotes around values (since the whole block is an exec) and the other side will just have 1 single quote.

    and cvTaxStatus = 'NONTAX'
    and cvTaxStatus = ' 'NONTAX' ' (those are 2-single quotes and not a double quote)

    I have made a Grammar rule with a regular expression ''\w+'' (again 2 single quotes not the double quote character).

    The right side of the file now shows "black", but the whole line is not showing up an an un-important difference (although I have made this new rule unimportant).

    Can someone make a suggestion on how I might make this work?

  • #2

    In the above sample text, there appears to be a space between the pair of single quotes (' '). Is this accurate of your main file, or is the main file without a space ('')?

    If you are using Pro, we have the Session menu -> Session Settings, Misc tab, create a new Text Replacement of:
    ' = ' '

    This can then make this change of quotes unimportant, and the unimportant quotes themselves can be ignored.

    Or, if the entire string should be unimportant, you could use a pair of Delimited grammars, with the same name, such as
    String = ' to '
    String = ' ' to ' '

    the grammar can then be Important or Unimportant, where the second quote ' would still show as a difference.

    Do either of these tips help get your comparison working as expected?
    Aaron P Scooter Software