No announcement yet.

Filter Specificity

  • Filter
  • Time
  • Show
Clear All
new posts

  • Filter Specificity

    Say under "include files" I have

    and under "exclude files" I have

    well... I think all *.ext files should be excluded except filename.ext and somedir/*.ext

    since this feature could change existing behavior, it may be desired to have a "Use Specificity" checkbox added to the filters dialog/tab...

  • #2
    Hi bkdotcom,

    You shouldn't need the extra Exclude *.ext. By including, that implies that all other files should be hidden. Removing the exclude should then only show your filename.ext and somedir/*.ext.

    Please note that somedir\*.ext will match on any folder named somdir\*.ext, no matter where it appears in the list. ".\somedir\*.ext" will only be the BASEFOLDER\somedir\*.ext.

    Also, please note the use of \ instead of / (Windows style slashes, assuming a Windows Environment).
    Aaron P Scooter Software


    • #3
      but I'd like all *.ext files excluded EXCEPT for specificfile.ext or somedir\*.ext
      all_other_folders\*.ext (incl .\*.ext) should still be excluded..

      specific example: I've gotten in the habit of prefixing folder names with a "_" if it's a backup folder or I just don't want to sync it...
      So I have a Exclude folders rule: _*
      BUT: now there's a specific _somefolder that I want included..
      putting _somefolder under include folders does no good, because _* supercedes it

      Well.. "_somefolder" is more specific than "_*" So, in my view, "_somefolder" should be included (or at least have the option of including it)


      • #4
        OK, I see where the confusion lies....

        Include files:

        Exclude files:

        I'm wanting to compare more than just files named somefile.ext
        There could be hundreds of folders or files with various extensions/names in this comparison....
        In general, I want *.ext excluded everywhere... but there are always exceptions.. In this case, somefile.ext is more specific that *.ext...


        • #5
          This may be best done in two sessions. Since including a specific, by definition, then excludes things that are not that specific, you'll need one session that excludes all *.ext files, and a second session that compares your two specific somefile.ext and .\somedir\*.ext

          If you would like to discuss a more specific example but do not want to post it to our public forums, you can email us at [email protected] and include a link to this post.
          Aaron P Scooter Software


          • #6
            It's no big deal.. just a bit of annoyance for a few comparisons I do.. I thought surely, I wasn't the only one occasionaly needed exceptions to their wildcards or what-have-you.
            I'm more of the one session-to-rule-them-all school.. (or 1-per-project if possible)

            Recently, I was reading up on css Specificity and how it's calculated. It dawned on me that I was looking for something similar in Beyond Compare.


            • #7
              Thanks for the reference link. If you stumble across any for Regular Expressions, be sure to let us know. For now, the best way to tackle the issue will be multiple sessions.
              Aaron P Scooter Software


              • #8
                There is no built-in concept of specificity in regular expressions. The expression is binary (true or false, match or nomatch). While one might be able to take a result-set from a regular expression and analyze it with other non regex coding to determine which result is a "better" match to the regular expression, there is nothing built-in to do this for you.
                BC v4.0.7 build 19761


                • #9
                  Well... since the filters are "masks" as opposed to REs, assigning a Specificity grade could be done based on some rules.. based on number of wildcards in each component of the file-mask (dir/basename.extension)
                  but it appears the rules may be arbitrary.. for example which is more specific here?:
                  somedir\*_file.* or *_file.ext
                  I'm leaning towards the latter..

                  Something to ponder.