LIKEX Operator

Checks if a string value matches a given pattern using regular expressions.

 

Syntax

 

expression [NOT] LIKEX expression

 

The LIKEX operator syntax has these parts:

 

Part

Description

expression

The value of interest and a pattern.

 

Remarks

 

Use the LIKEX operator to check if a string value matches a given pattern. If the value matches the pattern, the operator returns True; otherwise, it returns False.

 

For syntax that may be used in the pattern see the Regular Expressions topic.

 

If either the checked value or the pattern is NULL, the LIKEX operator also returns NULL.

 

Examples

 

This example uses the LIKEX operator to select all products whose name contains "'s" at the end of the word that is not the last word:

 

SELECT * FROM [Products] WHERE [Product Name] LIKEX ".+'s .+";

 

This example uses the LIKEX operator to select all customers whose phone contains three-digit area code:

 

SELECT * FROM [Customers] WHERE [Phone] LIKEX ".*\(\d{3}\).*";

 

This example uses the LIKEX operator to select all customers whose company names consist of at least three words:

 

SELECT * FROM [Customers] WHERE [Company Name] LIKEX "\S* \S* \S.*";

 

This example uses the LIKEX operator to select all customers whose company name includes the word "the", ignoring the case:

 

SELECT * FROM [Customers] WHERE LCase([Company Name]) LIKEX ".*\bthe\b.*";