Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.24 KB

File metadata and controls

40 lines (28 loc) · 1.24 KB
description
Tests whether the entire expression matches a pattern.

SIMILAR_TO

Syntax

expression SIMILAR TO pattern → boolean

  • expression: The expression to compare.
  • pattern: The pattern that is compared to the expression.

Examples

{% code title="SIMILAR_TO example" %}

SELECT 'shortcakes' SIMILAR TO '%cake_'
-- True

{% endcode %}

expression SIMILAR TO pattern ESCAPE escape_character → boolean

  • expression: The expression to compare.
  • pattern: The pattern that is compared to the expression.
  • escape: Putting an escape_character before a wildcard in the pattern makes SIMILAR TO treat the wildcard as a regular character when it appears in the expression.

Examples

{% code title="SIMILAR_TO example" %}

SELECT '100%' SIMILAR TO '100!%' ESCAPE '!'
-- True

{% endcode %}

Usage Notes

Succeeds only if the pattern matches the entire expression.