ApSIC Xbench Forum

How to highlight something, if it exists, but show error anyway, if it doesn't exist

For example, I’m looking for “ABC” in target and I want to flag the existence of “ABC” in target as an error regardless of whether it exists in source or not.
However, I would like to highlight it in source, if it’s there, for more clarity.
I’m trying regexps:
ABC|.
.|ABC
(So “.” would just highlight the first character if “ABC” is not there.)
But what I’m getting is the first character is highlighted always, regardless of whether “ABC” is there or not.

Hi,

If you want to find “ABC” in target regardless of whether or not it exists in source, the most simple search should be the following one:

Target: ABC
Search mode: Simple
Powersearch: Off

You may enable other search options such as Case Sensitive or Match Whole Word.

Oscar

Finding it in target is not a problem.
My question is how can I highlight it in source IF it exists (but still look for the one in target even if it doesn’t exist in source)?

I thought that if I look for regexp:
ABC|.
in source, then it would first look for ABC and highlight that, then if not found, it would just look for anything (so essentially highlight the first character).

E.g.
Source 1. DEFGH ABC IJKLM
Target 1. XCXCX ABC ZVZVZ
Source 2. DEFGH DEF IJKLM
Target 2. XCXCX ABC ZVZVZ
Source 3. DEFGH DEF IJKLM
Target 3. XCXCX DEF ZVZVZ

I want Xbench to:

  • Flag segments 1 & 2 (because they have ABC in target)
  • In source of segment 1 highlight ABC
  • In source of segment 2 there’s no ABC so I don’t care about highlighting anything

The goal is to be able to visually link ABC from target with ABC from source, if such ABC in source exists.

I think it is necessary to create two checklist entries.

1st entry:

Source: ^. -ABC
Target: ABC
Search mode: Regular Expressions
PowerSearch: On.

This entry will find all segments that contain ABC in target but is missing in source and highlight ABC in target and the 1st character in source.

2nd entry:

Source: ABC
Target: ABC
Search mode: Simple
PowerSearch: On.

This entry will find all segments that contain ABC in source and target. It will also highlight only ABC in source and target.

Regards,
Oscar.

Actually, I found a way to do it with one check:
Source: ABC|.$
Target: ABC

. wasn’t working because it was always being found first, but .$ is only found if there’s no ABC at all