Difference between power search and search with regular expressions

I always thought searching with Ctrl+P returns the same results as searching with regular expressions but there seems to be a difference. Searching for the source term “abc” with the target term “-abc” only returns -abc in the search mode Regular Expressions, not with Ctrl+P.

1 Like

PowerSearch function (Ctrl+P) allows you to perform negative or conditional searches. You can search for entries:

  1. string1 string2
    It finds all entries that contain “string1” and “string2”

  2. string1 or string2
    It finds all entries that contain “string1” or “string2”

  3. string1 -string2
    It finds all entries that contain “string1” but do not contain “string2”

  4. string1 -"string2 with embedded blanks"
    It finds all entries that contain “string1” but do not contain “string2 with embedded blanks”

- works as a negative operator. If you perform the following search:
Source Term: abc
Target Term: -abc

Xbench will find all entries that contain abc in source but do not contain abc in target.

Regular Expressions and Powersearch are complementary. For instance, if you run the following search:
Source Term: “^A"
Target Term: -”^A"
Select Regular Expressions as Search Mode and press Ctrl+P.

In regular expressions, ^ means beginning of string.

Xbench will find any entries where source begins with A but target do not.

However, if you run the following search:
Source Term: "^A"
Target Term: "^A"
Select Regular Expressions as Search Mode and press Ctrl+P.

Xbench will find all entries where both source and target term begin with A.

I highly recommend you the following videos on the Xbench youtube channel:

  1. How to Use PowerSearch in Xbench: https://www.youtube.com/watch?v=UuqJDVWF9Bk

  2. Using APSIC Xbench 3.0 Checklists for QA (Part 1): https://www.youtube.com/watch?v=pwWs1I0A1uY

  3. Using APSIC Xbench 3.0 Checklists for QA (Part 2): https://www.youtube.com/watch?v=7CfYu_eDLks

The videos about using checklists for QA show some regular expressions examples.

You can find more information about regular expressions and powersearch at the online help and the user guide.

You can post at the forum if you need help with any regular expression.

There are two layers in Xbench searches:

  • Layer 1: The base search, which can be in one of these three Search Modes: Simple, Regular Expressions, or MS Word Wildcards.
  • Layer 2: PowerSearch (Ctrl+P), which uses Google conditional operators (i.e. nothing for logical AND, “or” for logical OR, and minus sign ("-") for logical NOT.

So in your example, when you press Ctrl+P, you activate Powersearch (Layer 2) and the minus sign is parsed as a logical NOT instead of as part of the string to search.

If you need that in Powersearch the leading minus sign is considered part of string (not a logical NOT operator), you need to enclose the whole search expression in double quotes.