Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11
    Join Date
    Apr 2008
    Posts
    2,154

    Default

    Quote Originally Posted by Erik View Post
    You can't "disable" a grammar item. The only way to prevent it from classifying text is to delete it.
    Shouldn't the Keyword item be disabled by a match on the the higher Tag item? As per the documentation:

    Text Format Grammar Settings
    ...
    Items higher on the list take precedence over lower items.

  2. #12
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    Hello Chris,

    The order is significant in helping to break ties between multiple possible matches. However, other factors can make a section of text match one grammar over another before the list precedence is used. In this example, the length of the match matters more than the position in the priority list. The 'Keyword' is a longer match than the left side of the delimiter ("<"). In this case, the longest match will used. If they are equal in length, then the list's priority breaks a tie.
    Aaron P Scooter Software

  3. #13
    Join Date
    Apr 2008
    Posts
    2,154

    Default

    Quote Originally Posted by Aaron View Post
    The order is significant in helping to break ties between multiple possible matches. However, other factors can make a section of text match one grammar over another before the list precedence is used.
    Thanks. That's news to me, despite me having read the Help. Did I miss it somewhere?

    Quote Originally Posted by Aaron View Post
    In this example, the length of the match matters more than the position in the priority list. The 'Keyword' is a longer match than the left side of the delimiter ("<"). In this case, the longest match will used.
    Note that in this case the longest match is Tag, and it is not being used.

  4. #14
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    Quote Originally Posted by chrisjj View Post
    Thanks. That's news to me, despite me having read the Help. Did I miss it somewhere?

    Note that in this case the longest match is Tag, and it is not being used.
    The delimited type matches on the left side first, and the left side of tag is only "<". Making this behavior clearer and improving on it in general is on our wishlist for a future version of Beyond Compare.

    I recommend creating the copy of the File Format, and deleting the Keyword definition from the copy. You can then toggle between the two methods of comparison using the dropdown on the toolbar.
    Aaron P Scooter Software

  5. #15
    Join Date
    Apr 2008
    Posts
    2,154

    Default

    Quote Originally Posted by Aaron View Post
    The delimited type matches on the left side first, and the left side of tag is only "<". Making this behavior clearer and improving on it in general is on our wishlist for a future version of Beyond Compare.
    Thanks. I suggest precedence should go by what matches the element, not just part of the element "first".

  6. #16
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    11,384

    Default

    Agreed, which is why improving and expanding on this behavior is on our wishlist.
    Aaron P Scooter Software

  7. #17
    Join Date
    Oct 2007
    Posts
    437

    Default

    In your case, you can get the behavior you desire by modifying your "Tag" grammar item definition. Switch the category to Basic, enable Regular expression, and enter the following text:
    Code:
    <[^>]*>
    Erik Scooter Software

  8. #18
    Join Date
    Apr 2008
    Posts
    2,154

    Default

    Thanks Eric, but that fails on line breaks.

    Quote Originally Posted by Aaron View Post
    Agreed, which is why improving and expanding on this behavior is on our wishlist.
    OK!

Posting Permissions

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