Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.03 KB

File metadata and controls

42 lines (32 loc) · 1.03 KB
description
Returns true when the specified regular expression matches values in a column. Otherwise, returns false.

REGEXP_LIKE

Syntax

REGEXP_LIKE(input string, regex string) → boolean

  • input: The expression to test.
  • regex: The Perl-compatible regular expression (PCRE) to use for the test.

Examples

{% code title="REGEXP_LIKE example" %}

SELECT REGEXP_LIKE('the data lakehouse', '.*?\Qlake\E.*?')
-- True

{% endcode %}

{% code title="REGEXP_LIKE example" %}

SELECT Category, REGEXP_LIKE(Category, '.*?\Q-\E.*?') 
FROM eth.recent_blocks 
LIMIT 5

-- Category, EXPR$1
-- WEAPON LAWS, false
-- WEAPON LAWS, false
-- WARRANTS, false
-- NON-CRIMINAL, true
-- NON-CRIMINAL, true

{% endcode %}

Usage Notes

This function is identical to the function REGEXP_MATCHES.