Announcement

Collapse
No announcement yet.

Using BC for regex file content

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using BC for regex file content

    I have a test log that I want to compare against a template - both files have the same name. The template has regex and the test log does not.

    Sample A:
    Code:
    Size [0-9]*
    in my template matches
    Code:
    Size 1056
    in my actual log.

    Sample B:
    Code:
    Size [0-9]*
    in my template does not match
    Code:
    Size foo
    in my actual log.

    Is there anyway to teach BC4 to ignore Sample A and flag Sample B?

    All my searches lead me to using regex in BC rather than using BC for content with regex. Thanks!

  • #2
    Hello,

    BC4 can be configured to ignore this type of change using either Text Replacements (Pro feature) for Text to Text, or using Unimportance (Text generally).

    The Text Replacement sounds closer to what you need, and if you are already registered for Std you can set to trial mode to test before purchase/upgrade is necessary:
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro

    Both strategies do not interpret the RegEx in Sample A. The "reg ex" in the text is plain text, and the rules to ignore it cannot interpret it into the mask.

    For example, you can have a Text Replacement that is literal:
    Size [0-9]*
    to
    Size 1056

    Or, if you flip sides (so the Size 1056 is the Text to Find) you can define a Reg Ex to match on that text, then match to the literal text of the RegEx:
    Size [0-9]* (enable RegEx)
    to
    Size [0-9]*
    Aaron P Scooter Software

    Comment


    • #3
      Thanks for the quick response - text replacements (esp. option #2) work great! My only gripe is I wish there was some grammar-level way to do this. I have a whole ton of different regex I need to match - but at least given enough elbow grease, I should be able to make it work.

      Comment


      • #4
        Thanks. The current functionality only supports per session, or defining as part of the global defaults for the Text Compare (Home screen) as a single, large list used for any future Text Compare sessions.
        Aaron P Scooter Software

        Comment

        Working...
        X