# Difference between power search and search with regular expressions

**URL:** <https://forum.xbench.net/t/difference-between-power-search-and-search-with-regular-expressions/79>\
**Category:** General Discussion\
**Created:** [February 16, 2016, 6:17am UTC](https://forum.xbench.net/t/difference-between-power-search-and-search-with-regular-expressions/79 "2016-02-16T06:17:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sulima](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sulima](https://forum.xbench.net/u/Sulima)\
**Post date:** [February 16, 2016, 6:17am UTC](https://forum.xbench.net/t/difference-between-power-search-and-search-with-regular-expressions/79/1 "2016-02-16T06:17:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [February 16, 2016, 8:48am UTC](https://forum.xbench.net/t/difference-between-power-search-and-search-with-regular-expressions/79/2 "2016-02-16T08:48:59Z")

</div>

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](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](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](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.

---

<div class="post-metadata">

**Author:** ![pcondal](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/pcondal/32/305_2.png) [@pcondal](https://forum.xbench.net/u/pcondal)\
**Post date:** [February 16, 2016, 9:59am UTC](https://forum.xbench.net/t/difference-between-power-search-and-search-with-regular-expressions/79/3 "2016-02-16T09:59:41Z")

</div>

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.
